qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K
       [not found]   ` <68676e00912290539n3f9f9291q54c60e78cdec1611@mail.gmail.com>
@ 2010-01-04  8:34     ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-01-04  8:34 UTC (permalink / raw)
  To: Luca Tettamanti; +Cc: Avi Kivity, kvm, qemu-devel

On Tue, Dec 29, 2009 at 02:39:38PM +0100, Luca Tettamanti wrote:
> Linux tools put the first partition at sector 63 (512-byte) to retain
> compatibility with Windows;

Well, some of them, and depending on the exact disks.  It's all rather
complicated.

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

Linux doesn't care.  As doesn't windows.  But performance on mis-aligned
partitions will suck badly - both on 4k sector drives, SSDs or probably
various copy on write layers in virtualization once you hit the worst
case.  Fortunately the block topology information present in recent
ATA and SCSI standards allows the storage hardware to tell about the
required alignment, and Linux now has a topology API to expose it, which
is used by the most recent versions of the partitioning tools and
filesystem creation tools.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K
       [not found] <1262081278-1858-1-git-send-email-avi@redhat.com>
       [not found] ` <20091229132128.GB5736@shareable.org>
@ 2010-01-04  8:36 ` Christoph Hellwig
  1 sibling, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-01-04  8:36 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel, kvm

On Tue, Dec 29, 2009 at 12:07:58PM +0200, Avi Kivity wrote:
> Guests use this number as a hint for alignment and I/O request sizes.  Given
> that modern disks have 4K block sizes, and cached file-backed images also
> have 4K block sizes, this hint can improve guest performance.
> 
> 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.

The information is correct per the ATA spec, but:

 (a) as mentioned above it should not be used for old machine types
 (b) we need to sort out passing through the first block alignment bits
     that are also in IDENTIFY word 106 if using a raw block device
     underneat
 (b) probably need to adjust the physical blocks size depending on the
     underlying storage topology.

I have a patch in my queue for a while now dealing with (b) and parts of
(c), but it's been preempted by more urgent work.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-04  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1262081278-1858-1-git-send-email-avi@redhat.com>
     [not found] ` <20091229132128.GB5736@shareable.org>
     [not found]   ` <68676e00912290539n3f9f9291q54c60e78cdec1611@mail.gmail.com>
2010-01-04  8:34     ` [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K Christoph Hellwig
2010-01-04  8:36 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).