From: Andrew Morton <akpm@linux-foundation.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
jaxboe@fusionio.com, Wu Fengguang <fengguang.wu@intel.com>
Subject: Re: [PATCH 2/3 v2] mm: Fix writeback_in_progress()
Date: Thu, 5 Aug 2010 17:10:25 -0700 [thread overview]
Message-ID: <20100805171025.1d7efaba.akpm@linux-foundation.org> (raw)
In-Reply-To: <1281034399-13055-3-git-send-email-jack@suse.cz>
On Thu, 5 Aug 2010 20:53:18 +0200
Jan Kara <jack@suse.cz> wrote:
> Commit 83ba7b071f30f7c01f72518ad72d5cd203c27502 broke writeback_in_progress()
> as in that commit we started to remove work items from the list at the
> moment we start working on them and not at the moment they are finished.
> Thus if the flusher thread was doing some work but there was no other
> work queued, writeback_in_progress() returned false. This could in
> particular cause unnecessary queueing of background writeback from
> balance_dirty_pages() or writeout work from writeback_sb_if_idle().
>
> This patch fixes the problem by introducing a bit in the bdi state which
> indicates that the flusher thread is processing some work and uses this
> bit for writeback_in_progress() test.
>
> NOTE: Both callsites of writeback_in_progress() (namely,
> writeback_inodes_sb_if_idle() and balance_dirty_pages()) would actually
> need a different information than what writeback_in_progress() provides.
> They would need to know whether *the kind of writeback they are going
> to submit* is already queued. But this information isn't that simple
> to provide so let's fix writeback_in_progress() for the time being.
>
Patch looks reasonable, but.. What effect does it have?
writeback_inodes_sb_if_idle() is some ext4 delalloc hack. Shudder, no
comment.
The writeback_in_progess() test in balance_dirty_pages() is at least
eight years old. I got bored digging back through the git record
working out why I added it (that line's been changed multiple times and
it's a pita tracking back through those things).
I suspect it was there to say "don't bother poking pdflush if it's
already doing something". But perhaps that logic got broken by
subsequent mauling. Or was never right. For example, if the kupdate
function is writing back an old inode, do we really want that to
prevent balance_dirty_pages()'s attempt to cure a dirty-memory-exceeded
situation? Don't think so.
So I dunno. I suspect a better patch would be "remove
writeback_in_progess()". But first one should find the
patch which added the test to balance_dirty_pages() and
see if it was well changelogged.
But this patch's changelog doesn't make me confident that the
end-user-visible effects of this change are fully understood?
next prev parent reply other threads:[~2010-08-06 0:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 18:53 [PATCH 0/3 v2] Three writeback fixes to stop sync(1) livelocks Jan Kara
2010-08-05 18:53 ` [PATCH 1/3 v2] mm: Stop background writeback if there is other work queued for the thread Jan Kara
2010-08-05 19:38 ` Jens Axboe
2010-08-05 23:45 ` Andrew Morton
2010-08-07 16:04 ` Wu Fengguang
2010-08-08 2:43 ` Jan Kara
2010-08-08 3:10 ` Wu Fengguang
2010-08-08 4:12 ` Dave Chinner
2010-08-08 7:29 ` Wu Fengguang
2010-08-08 11:07 ` Jens Axboe
2010-08-08 13:59 ` Jan Kara
2010-08-08 22:55 ` Wu Fengguang
2010-08-05 18:53 ` [PATCH 2/3 v2] mm: Fix writeback_in_progress() Jan Kara
2010-08-05 19:37 ` Jens Axboe
2010-08-05 23:06 ` Wu Fengguang
2010-08-06 0:10 ` Andrew Morton [this message]
2010-08-08 2:25 ` Jan Kara
2010-08-05 18:53 ` [PATCH 3/3 v2] mm: Avoid resetting wb_start after each writeback round Jan Kara
2010-08-05 19:38 ` Jens Axboe
2010-08-06 0:21 ` Andrew Morton
2010-08-07 22:45 ` Jan Kara
2010-08-06 12:23 ` [PATCH 0/3 v2] Three writeback fixes to stop sync(1) livelocks Christoph Hellwig
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=20100805171025.1d7efaba.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=jaxboe@fusionio.com \
--cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.