From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] vfs: Merge sync_supers(), sync_filesystems() and sync_blockdevs()
Date: Thu, 23 Apr 2009 08:31:27 -0400 [thread overview]
Message-ID: <20090423123126.GA25313@infradead.org> (raw)
In-Reply-To: <1240415781-17834-3-git-send-email-jack@suse.cz>
On Wed, Apr 22, 2009 at 05:56:21PM +0200, Jan Kara wrote:
> These three functions are quite similar so merge them to save superblock list
> traversal code. As a bonus we get livelock avoidance for all these superblock
> traversals. Also remove the condition that if wait == 0 and sb->s_dirt is
> not set, then ->sync_fs() is not called. This does not really make much sence
> since s_dirt is generally used by filesystem to mean that ->write_super() needs
> to be called. But ->sync_fs() does different things. I even suspect that some
> filesystems (btrfs?) sets s_dirt just to fool this logic.
Some more comments after looking at it in more details:
- the FSSYNC_SUPER case really needs to do a trylock on the mutex,
otherwise any in-progress sync would block pdflush for a long time.
And as any real sync should write out the superblock it's not needed
anyway during that time. (Need to double-check the filesystems,
though)
- sync_filesystems really should move to fs/sync.c
- I get more and more inclined to make sync just case of looping over
the superblocks and do an fsync_super. A plain sync fsync_super
might be too slow so we can try to do an async one first and then
a sync one as a second pass
- that wakeup_pdflush in do_sync looks extremly fishy, we need to do
all page writeback via sync_inodes_(sb) anyway, and doing this in
parallel from pdflush just introduced tons of potential race
opportunities
- now if sync_filesystems just ends up calling __fsync_super for
the normal sync path I wonder if there really is a point unifying
it with the periodic write_super case.
prev parent reply other threads:[~2009-04-23 12:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 15:56 [PATCH 0/2] Fix sys_sync() bug and slightly cleanup the code Jan Kara
2009-04-22 15:56 ` [PATCH] vfs: Fix sys_sync() and fsync_super() reliability Jan Kara
2009-04-22 17:16 ` Trond Myklebust
2009-04-22 17:23 ` Jan Kara
2009-04-23 11:10 ` Christoph Hellwig
2009-04-23 13:07 ` Jan Kara
2009-04-23 13:09 ` Christoph Hellwig
2009-04-22 15:56 ` [PATCH] vfs: Merge sync_supers(), sync_filesystems() and sync_blockdevs() Jan Kara
2009-04-22 17:20 ` Trond Myklebust
2009-04-23 11:06 ` Christoph Hellwig
2009-04-23 12:31 ` Christoph Hellwig [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=20090423123126.GA25313@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=jens.axboe@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).