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

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

 



On Tue, Dec 29, 2009 at 2:21 PM, Jamie Lokier <jamie@xxxxxxxxxxxxx> wrote:
> 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?

Yes, there are WD disks in the wild with 4k blocks, although in this
first transition phase the firmware hides the fact and emulates the
old 512b sector.

>> 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?

Linux tools put the first partition at sector 63 (512-byte) to retain
compatibility with Windows; Linux itself does not have any problem
with different layouts. See e.g. [1]
The problem seems to be limited to Win 5.x (XP, 2k3) and WD has an
utility[2] to re-align partitions in this case, so I guess that they
do cope fine with a 4k-aligned partition table, they just create it
unaligned by default.

> 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

Ugh, I hope you're wrong ;-) AFAICS remapping will lead only to
headaches... Linux does not have any problem with aligned partitions.

Luca
[1] http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/
[2] http://support.wdc.com/product/download.asp?groupid=805&sid=123&lang=en
--
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