linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Theodore Tso <tytso@MIT.EDU>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [Bug 421482] Firefox 3 uses fsync excessively
Date: Mon, 26 May 2008 11:49:55 -0700	[thread overview]
Message-ID: <20080526114955.82c062f2.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080526100751.GB24507@mit.edu>

On Mon, 26 May 2008 06:07:51 -0400 Theodore Tso <tytso@MIT.EDU> wrote:

> On Mon, May 26, 2008 at 12:05:06AM -0700, Andrew Morton wrote:
> > It's purportedly showing that fdatasync() on ext3 is syncing the whole
> > world in fsync()-fashion even with an application which does not grow
> > the file size.
> > 
> > But fdatasync() shouldn't do that.  Even if the inode is dirty from
> > atime or mtime updates, that shouldn't cause fdatasync() to run an
> > ext3 commit?
> 
> Well, ideally it shouldn't, although POSIX allows fdatasync() to be
> implemented in terms of fsync().  It is at the moment.  :-/

Well..

> The problem is we don't currently have a way of distinguishing between
> a "smudged" inode (only the mtime/atime has changed) and a "dirty"
> inode (even if the number of blocks hasn't changed, if i_size has
> changed, or i_mode, or anything else, including extended attributes
> inline in the inode).

Who do you mena by "we"?  ext3 or the kernel as a whole?

>  We're not tracking that difference.  If we only
> allow mtime/atime changes through setattr (see Cristoph's patches),
> and don't set the VFS dirty bit, but our own "smudged" bit, we could
> do it --- but at the moment, we're not.

But the VFS _does_ track these things, via the eternally
incomprehensible I_DIRTY_SYNC and I_DIRTY_DATASYNC.

We have:

	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
		goto out;

which _should_ cause the fs to skip the commit during fdatasync() if
only mtime and ctime have changed?


      parent reply	other threads:[~2008-05-26 18:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-421482-310856@https.bugzilla.mozilla.org/>
     [not found] ` <200805260513.m4Q5DAU8018498@mrapp54.mozilla.org>
2008-05-26  7:05   ` [Bug 421482] Firefox 3 uses fsync excessively Andrew Morton
2008-05-26 10:07     ` Theodore Tso
2008-05-26 11:10       ` Jörn Engel
2008-05-26 11:38         ` Theodore Tso
2008-05-26 12:52           ` Jörn Engel
2008-05-26 20:22             ` Jamie Lokier
2008-05-29 17:08               ` fdatasync/barriers (was : [Bug 421482] Firefox 3 uses fsync excessively) Bryan Henderson
2008-05-29 18:46                 ` jim owens
2008-05-29 23:15                   ` Bryan Henderson
2008-05-30  4:00                     ` Timothy Shimmin
2008-05-30 14:14                       ` jim owens
2008-05-30 16:25                         ` Bryan Henderson
2008-05-30 18:48                           ` jim owens
2008-06-02 17:31                             ` Bryan Henderson
2008-05-26 18:49       ` Andrew Morton [this message]

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=20080526114955.82c062f2.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@MIT.EDU \
    /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;
as well as URLs for NNTP newsgroup(s).