From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jan Engelhardt <jengelh@medozas.de>, Jan Kara <jack@suse.cz>,
Linux Kernel <linux-kernel@vger.kernel.org>,
stable@kernel.org, Greg KH <gregkh@suse.de>,
Jens Axboe <jaxboe@fusionio.com>
Subject: Re: Sync writeback still broken
Date: Fri, 29 Oct 2010 20:18:35 -0700 [thread overview]
Message-ID: <20101029201835.c79348da.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTikEpV7GWG9fd3=zfrhOZtbPvxJWfXAO30iN8aae@mail.gmail.com>
On Fri, 29 Oct 2010 18:16:48 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Fri, Oct 29, 2010 at 5:57 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > Guys, what is the status of this?
> >
> > The original patch in that email thread still makes no sense and the
> > commit log for it cannot be the real issue. But the _problem_ seems to
> > be real, and the code is apparently a total mess, still.
>
> Btw, is the problem just that insane WB_SYNC_ALL thing?
>
> The problem with WB_SYNC_ALL seems to be that it synchrnously writes
> out one inode at a time. And it's not just the data, it's the inode
> itself.
>
> So rather than write out all pages for _all_ inodes, and then wait for
> them, and write out _all_ metadata, and then wait for that, it seems
> like the WB_SYNC_ALL code does the truly stupid thing, which is to
> "write out some data for one inode, then _synchronously_ wait for
> that, then write out the metadata for that single inode, then
> _synchronously_ wait for THAT" and then rinse and repeat for each
> inode.
>
> The sane thing for "WB_SYNC_ALL" would be to:
> - for_each_inode: write out all data (no waiting)
> - for_each_inode: wait for the data for that inode, write out the inode
> - for_each_inode: wait for the inode
>
> so that you avoid the whole synchronous wait thing, and can do all
> inodes in one go.
The way I originally implemented all this was that the top level would
do two passes. The first was as async as possible, to get lots of IO
underway against lots of devices. Then the second pass was WB_SYNC_ALL
to get any straggler IO started and then to wait on everything. eg
(2.6.20):
static void do_sync(unsigned long wait)
{
wakeup_pdflush(0);
sync_inodes(0); /* All mappings, inodes and their blockdevs */
DQUOT_SYNC(NULL);
sync_supers(); /* Write the superblocks */
sync_filesystems(0); /* Start syncing the filesystems */
sync_filesystems(wait); /* Waitingly sync the filesystems */
sync_inodes(wait); /* Mappings, inodes and blockdevs, again. */
if (!wait)
printk("Emergency Sync complete\n");
if (unlikely(laptop_mode))
laptop_sync_completion();
}
note the two sync_inodes() calls and the two sync_filesystems() calls.
This used to work reasonably well. Maybe it got broken, who knows.
next prev parent reply other threads:[~2010-10-30 3:19 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 9:16 [PATCH] writeback: Fix broken sync writeback Jens Axboe
2010-02-12 15:45 ` Linus Torvalds
2010-02-13 12:58 ` Jan Engelhardt
2010-02-15 14:49 ` Jan Kara
2010-02-15 15:41 ` Jan Engelhardt
2010-02-15 15:58 ` Jan Kara
2010-06-27 16:44 ` Jan Engelhardt
2010-10-24 23:41 ` Sync writeback still broken Jan Engelhardt
2010-10-30 0:57 ` Linus Torvalds
2010-10-30 1:16 ` Linus Torvalds
2010-10-30 1:30 ` Linus Torvalds
2010-10-30 3:18 ` Andrew Morton [this message]
2010-10-30 13:15 ` Christoph Hellwig
2010-10-31 12:24 ` Jan Kara
2010-10-31 22:40 ` Jan Kara
2010-11-05 21:33 ` Jan Kara
2010-11-05 21:34 ` Jan Kara
2010-11-05 21:41 ` Linus Torvalds
2010-11-05 22:03 ` Jan Engelhardt
2010-11-07 12:57 ` Jan Kara
2011-01-20 22:50 ` Jan Engelhardt
2011-01-21 15:09 ` Jan Kara
2010-02-15 14:17 ` [PATCH] writeback: Fix broken sync writeback Jan Kara
2010-02-16 0:05 ` Linus Torvalds
2010-02-16 23:00 ` Jan Kara
2010-02-16 23:34 ` Linus Torvalds
2010-02-17 0:01 ` Linus Torvalds
2010-02-17 1:33 ` Jan Kara
2010-02-17 1:57 ` Dave Chinner
2010-02-17 3:35 ` Linus Torvalds
2010-02-17 4:30 ` tytso
2010-02-17 5:16 ` Linus Torvalds
2010-02-22 17:29 ` Jan Kara
2010-02-22 21:01 ` tytso
2010-02-22 22:26 ` Jan Kara
2010-02-23 2:53 ` Dave Chinner
2010-02-23 3:23 ` tytso
2010-02-23 5:53 ` Dave Chinner
2010-02-24 14:56 ` 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=20101029201835.c79348da.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=jack@suse.cz \
--cc=jaxboe@fusionio.com \
--cc=jengelh@medozas.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.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