linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Curt Wohlgemuth <curtw@google.com>,
	Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH 5/5] vfs: Avoid unnecessary WB_SYNC_NONE writeback during sync(1)
Date: Wed, 27 Jul 2011 05:52:48 -0400	[thread overview]
Message-ID: <20110727095248.GE11334@infradead.org> (raw)
In-Reply-To: <1311719886-1130-6-git-send-email-jack@suse.cz>

> +static void __sync_filesystem(struct super_block *sb, int emergency)
>  {
> +	/* In case of emergency sync we don't want to wait for locks and IO */
> +	if (unlikely(emergency))
>  		writeback_inodes_sb(sb);
> +	else
> +		sync_inodes_sb(sb);
>  
>  	if (sb->s_op->sync_fs)
> +		sb->s_op->sync_fs(sb, 0);
>  }

This function doesn't make sense to me in the current form.  Why would
be do a blocking sync_inodes_sb, but then a non-blocking ->sync_fs?

> -static void sync_filesystems(int wait)
> +static void sync_filesystems(int emergency)
>  {
> -	iterate_supers(sync_one_sb, &wait);
> +	iterate_supers(sync_one_sb, &emergency);
>  }


I'd just drop the sync_filesystems wrapper, and also use individual
callbacks for the two cases.

>  SYSCALL_DEFINE0(sync)
>  {
> +	/* Start flushing on all devices */
>  	wakeup_flusher_threads(0);
> +	/*
> +	 * Above call queued work doing complete writeout on each filesystem.
> +	 * Now we queue work which guarantees data integrity of all inodes
> +	 * - not much should be left for it to write. The WB_SYNC_ALL inode
> +	 * writeback also guarantees that sync_fs() is called after inodes
> +	 * are written out and thus it can do meaningful work.
> +	 */
>  	sync_filesystems(0);

This really should be an iteration over sb_sync_fs with wait == 0

>  	sync_all_bdevs(0);
> +	/* Call blocking ->sync_fs() for each filesystem */
> +	iterate_supers(sb_sync_fs, NULL);

  reply	other threads:[~2011-07-27  9:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 22:38 [PATCH 0/5 v2] Improve sync(2) handling Jan Kara
2011-07-26 22:38 ` [PATCH 1/5] vfs: Make sync(1) writeout also block device inodes Jan Kara
2011-07-27  9:44   ` Christoph Hellwig
2011-07-28 20:13     ` Jan Kara
2011-07-26 22:38 ` [PATCH 2/5] vfs: Move noop_backing_dev_info check from sync into writeback Jan Kara
2011-07-27  9:44   ` Christoph Hellwig
2011-07-26 22:38 ` [PATCH 3/5] quota: Split dquot_quota_sync() to writeback and cache flushing part Jan Kara
2011-07-27  8:26   ` Steven Whitehouse
2011-07-27  9:45   ` Christoph Hellwig
2011-07-26 22:38 ` [PATCH 4/5] quota: Move quota syncing to ->sync_fs method Jan Kara
2011-07-27  8:32   ` Steven Whitehouse
2011-07-27  9:46   ` Christoph Hellwig
2011-07-27 13:44   ` Dave Kleikamp
2011-07-26 22:38 ` [PATCH 5/5] vfs: Avoid unnecessary WB_SYNC_NONE writeback during sync(1) Jan Kara
2011-07-27  9:52   ` Christoph Hellwig [this message]
2011-07-28 17:42     ` Jan Kara
2011-07-28 20:37       ` Christoph Hellwig
2011-07-28 21:20         ` Curt Wohlgemuth
2011-07-29 11:09           ` Christoph Hellwig
2011-09-28 15:00 ` [PATCH 0/5 v2] Improve sync(2) handling Christoph Hellwig
2011-10-06 22:20   ` Jan Kara

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=20110727095248.GE11334@infradead.org \
    --to=hch@infradead.org \
    --cc=curtw@google.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).