[lkml]   [2010]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH][RF C/T/D] Unmapped page cache control - via boot parameter
On Wed, Mar 17, 2010 at 06:40:30PM +0200, Avi Kivity wrote:
> Chris, can you carry out an experiment? Write a program that pwrite()s
> a byte to a file at the same location repeatedly, with the file opened
> using O_SYNC. Measure the write rate, and run blktrace on the host to
> see what the disk (/dev/sda, not the volume) sees. Should be a (write,
> flush, write, flush) per pwrite pattern or similar (for writing the data
> and a journal block, perhaps even three writes will be needed).
> Then scale this across multiple guests, measure and trace again. If
> we're lucky, the flushes will be coalesced, if not, we need to work on it.

As the person who has written quite a bit of the current O_SYNC
implementation and also reviewed the rest of it I can tell you that
those flushes won't be coalesced. If we always rewrite the same block
we do the cache flush from the fsync method and there's is nothing
to coalesced it there. If you actually do modify metadata (e.g. by
using the new real O_SYNC instead of the old one that always was O_DSYNC
that I introduced in 2.6.33 but that isn't picked up by userspace yet)
you might hit a very limited transaction merging window in some
filesystems, but it's generally very small for a good reason. If it
were too large we'd make the once progress wait for I/O in another just
because we might expect transactions to coalesced later. There's been
some long discussion about that fsync transaction batching tuning
for ext3 a while ago.

 \ /
  Last update: 2010-03-17 18:01    [W:0.113 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site