Skip to content

block: Issue one virtio request per EFI transfer - #457

Open
ealmloff wants to merge 1 commit into
cloud-hypervisor:mainfrom
ealmloff:one-request-per-efi-read
Open

ealmloff wants to merge 1 commit into
cloud-hypervisor:mainfrom
ealmloff:one-request-per-efi-read

Conversation

@ealmloff

@ealmloff ealmloff commented Oct 22, 2026 •

Copy link
Copy Markdown

The EFI block protocol issued one 512 B virtio request per sector, so GRUB loading a kernel and initrd took ~150k VM exits. Let SectorRead/SectorWrite take any multiple of 512 bytes under 1 MiB and pass each ReadBlocks/WriteBlocks call through as a single request. Boot to first kernel line drops from 1.4s to 0.70s on a m5zn.metal.

A couple runs of a benchmark script booting jammy with this branch on m5zn.metal:

fw-stock  1.69s 1.41s 1.41s 1.41s 1.41s
fw-fixed  0.70s 0.70s 0.70s 0.70s 0.70s
fw-stock  1.41s 1.41s 1.41s 1.41s 1.41s
fw-fixed  0.70s 0.73s 0.70s 0.70s 0.70s
fw-stock  1.43s 1.41s 1.41s 1.43s 1.41s
fw-fixed  0.70s 0.70s 0.70s 0.70s 0.70s

The EFI block protocol issued one 512 B virtio request per sector,
so GRUB loading a kernel and initrd took ~150k VM exits. Let
SectorRead/SectorWrite take any multiple of 512 bytes under 1 MiB and
pass each ReadBlocks/WriteBlocks call through as a single request.
Boot to first kernel line drops from 1.4s to 0.70s on a m5zn.metal.

Signed-off-by: Evan Almloff <evanalmloff@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant