linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: Denys Fedorysychenko <nuclearcat@nuclearcat.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: endless sync on bdi_sched_wait()? 2.6.33.1
Date: Thu, 22 Apr 2010 10:06:52 +1000	[thread overview]
Message-ID: <20100422000652.GD23541@dastard> (raw)
In-Reply-To: <20100421132718.GA3327@quack.suse.cz>

On Wed, Apr 21, 2010 at 03:27:18PM +0200, Jan Kara wrote:
> On Wed 21-04-10 11:54:28, Dave Chinner wrote:
> > On Wed, Apr 21, 2010 at 02:33:09AM +0200, Jan Kara wrote:
> > > On Mon 19-04-10 17:04:58, Dave Chinner wrote:
> > > > The third flush - the sync one - does:
.....
> > > > some 75 seconds later having written only 1024 pages. In the mean
> > > > time, the traces show dd blocked in balance_dirty_pages():
.....
> > > > And it appears to stay blocked there without doing any writeback at
> > > > all - there are no wbc_balance_dirty_pages_written traces at all.
> > > > That is, it is blocking until the number of dirty pages is dropping
> > > > below the dirty threshold, then continuing to write and dirty more
> > > > pages.
> > >   I think this happens because sync writeback is running so I_SYNC is set
> > > and thus we cannot do any writeout for the inode from balance_dirty_pages.
> > 
> > It's not even calling into writeback so the I_SYNC flag is way out of
> > scope ;)
>   Are you sure? The tracepoints are in wb_writeback() but
> writeback_inodes_wbc() calls directly into writeback_inodes_wb() so you
> won't see any of the tracepoints to trigger. So how do you know we didn't
> get to writeback_single_inode?

The balance_dirty_pages() tracing code added this hunk:

@@ -536,11 +537,13 @@ static void balance_dirty_pages(struct address_space *mapping,
                 * threshold otherwise wait until the disk writes catch
                 * up.
                 */
+               trace_wbc_balance_dirty_start(&wbc);
                if (bdi_nr_reclaimable > bdi_thresh) {
                        writeback_inodes_wbc(&wbc);
                        pages_written += write_chunk - wbc.nr_to_write;
                        get_dirty_limits(&background_thresh, &dirty_thresh,
                                       &bdi_thresh, bdi);
+                       trace_wbc_balance_dirty_written(&wbc);
                }

                /*

So if we tried to do writeback from here, the
wbc_balance_dirty_written trace would have been emitted, and that is
not showing up very often in any of the traces. e.g:

$ grep balance t.t |grep start |wc -l
4356
$ grep balance t.t |grep wait |wc -l
2171
$ grep balance t.t |grep written |wc -l
7

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2010-04-22  0:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 16:07 endless sync on bdi_sched_wait()? 2.6.33.1 Denys Fedorysychenko
2010-03-31 22:12 ` Dave Chinner
2010-04-01 10:42   ` Denys Fedorysychenko
2010-04-01 11:13     ` Dave Chinner
2010-04-01 20:14       ` Jeff Moyer
2010-04-08  9:28 ` Jan Kara
2010-04-08 10:12   ` Denys Fedorysychenko
2010-04-12  0:47   ` Dave Chinner
2010-04-19  1:37   ` Dave Chinner
2010-04-19  7:04     ` Dave Chinner
2010-04-19  7:23       ` Dave Chinner
2010-04-21  0:33       ` Jan Kara
2010-04-21  1:54         ` Dave Chinner
2010-04-21 13:27           ` Jan Kara
2010-04-22  0:06             ` Dave Chinner [this message]
2010-04-22 12:48               ` 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=20100422000652.GD23541@dastard \
    --to=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuclearcat@nuclearcat.com \
    --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).