qemu-devel
[Top][All Lists]
Advanced

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

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


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K
Date: Tue, 29 Dec 2009 13:21:28 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]