Re: [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avi Kivity wrote:
> Guests use this number as a hint for alignment and I/O request sizes.

It's not just a hint.  It is also the "radius of corruption on failed
write" - important for journalling filesystems and databases.

> Given
> that modern disks have 4K block sizes,

Do they, yet?

> and cached file-backed images also have 4K block sizes, this hint
> can improve guest performance.

Agreed - but see below.

> We probably need to make this configurable depending on machine type.  It
> should be the default for -M 0.13 only as it can affect guest code paths.

What about that Windows/Linux 4k sectors incompatibility thing, where
disks with 4k sectors have to sense whether the first partition starts
at 512-byte sector 63 (Linux) or 512-byte sector 1024 (or something;
Windows), and then adjust their 512-byte sector to 4k-sector mapping
so that 4k blocks within the partition are aligned to 4k sectors?

Iirc, Linux (and old but not current Windows) tends to place the first
partition starting at sector 63, which means 4k filesystem blocks will
_not_ align to 4k blocks in the cached file-backed images with Qemu.

It has been discussed for hardware disk design with 4k sectors, and
somehow there were plans to map sectors so that the Linux partition
scheme results in nicely aligned filesystem blocks - so Qemu's IDE
(and SCSI) emulation should do the same.  Or should it?  I don't know
how the 4k sector thing worked out in the end, or if it's still in
discussion.

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux