mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jeffrey Siegal <jbs@quiotix.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why is fsync so much slower than O_SYNC?
Date: Thu, 18 Mar 2004 09:07:47 -0800	[thread overview]
Message-ID: <20040318090747.35c65219.akpm@osdl.org> (raw)
In-Reply-To: <4059C381.1000601@quiotix.com>

Jeffrey Siegal <jbs@quiotix.com> wrote:
>
> Andrew Morton wrote:
> > This is because ext3 is being dumb.  It is forcing a journal commit even
> > when the inode has not been altered.
> > 
> > Here's a moderately-tested 2.6 fix.  A 2.4 fix would be similar.
> > 
> > 
> > File overwrite:
> > 
> > 	vmm:/mnt/hda5> ~/fsync-is-sucky 
> > 	O_SYNC:
> > 	Creating
> > 	Starting
> > 	iter = 1000, latency = 0.191464ms
> > 
> > 	O_DSYNC:
> > 	Creating
> > 	Starting
> > 	iter = 1000, latency = 0.181637ms
> > 
> > 	fsync:
> > 	Creating
> > 	Starting
> > 	iter = 1000, latency = 0.186326ms
> > 
> > 	fdatasync:
> > 	Creating
> > 	Starting
> > 	iter = 1000, latency = 0.193013ms
> 
> Hmm, this doesn't seem right.  For an overwrite, it should still be 
> waiting for just the data page to be written out, and that should take 
> about 8ms (for a 7200rpm drive),

That's with the disk writeback cache enabled.

> and the append case should take longer, 
> since it requires writing both the data page and then the journal.

Append takes 40 times longer, because in that case we need to commit the
journal after each sync to write the modifed inode.


  reply	other threads:[~2004-03-18 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17 16:40 Jeffrey Siegal
2004-03-18  8:33 ` Andrew Morton
2004-03-18 15:42   ` Jeffrey Siegal
2004-03-18 17:07     ` Andrew Morton [this message]
2004-03-18 16:36   ` Jeffrey Siegal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040318090747.35c65219.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jbs@quiotix.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome