From: Andrew Morton <akpm@linux-foundation.org>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Chris Mason <chris.mason@oracle.com>,
linux-kernel@vger.kernel.org, jack@suse.cz
Subject: Re: [PATCH] bdi_sync_writeback should WB_SYNC_NONE first
Date: Sun, 27 Sep 2009 10:10:35 -0700 [thread overview]
Message-ID: <20090927101035.e8712819.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090927165513.GC23126@kernel.dk>
On Sun, 27 Sep 2009 18:55:14 +0200 Jens Axboe <jens.axboe@oracle.com> wrote:
> > I wasn't referring to this patch actually. The code as it stands in
> > Linus's tree right now attempts to write back up to 2^63 pages...
>
> I agree, it could make the fs sync take a looong time. This is not a new
> issue, though.
It _should_ be a new issue. The old code would estimate the number of
dirty pages up-front and would then add a +50% fudge factor, so if we
started the sync with 1GB dirty memory, we write back a max of 1.5GB.
However that might have got broken.
void sync_inodes_sb(struct super_block *sb, int wait)
{
struct writeback_control wbc = {
.sync_mode = wait ? WB_SYNC_ALL : WB_SYNC_NONE,
.range_start = 0,
.range_end = LLONG_MAX,
};
if (!wait) {
unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
unsigned long nr_unstable = global_page_state(NR_UNSTABLE_NFS);
wbc.nr_to_write = nr_dirty + nr_unstable +
(inodes_stat.nr_inodes - inodes_stat.nr_unused);
} else
wbc.nr_to_write = LONG_MAX; /* doesn't actually matter */
sync_sb_inodes(sb, &wbc);
}
a) the +50% isn't there in 2.6.31
b) the wait=true case appears to be vulnerable to livelock in 2.6.31.
whodidthat
38f21977663126fef53f5585e7f1653d8ebe55c4 did that back in January.
next prev parent reply other threads:[~2009-09-27 17:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 14:10 Chris Mason
2009-09-27 8:34 ` Andrew Morton
2009-09-27 16:44 ` Jens Axboe
2009-09-27 16:52 ` Andrew Morton
2009-09-27 16:55 ` Jens Axboe
2009-09-27 17:10 ` Andrew Morton [this message]
2009-09-29 16:13 ` Jan Kara
2009-09-28 13:32 ` Chris Mason
2009-09-29 20:47 ` Chris Mason
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=20090927101035.e8712819.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=chris.mason@oracle.com \
--cc=jack@suse.cz \
--cc=jens.axboe@oracle.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
all inboxes | Powered by JetHome®