From: Jan Kara <jack@suse.cz>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
Mel Gorman <mel@csn.ul.ie>, Rik van Riel <riel@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Minchan Kim <minchan.kim@gmail.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/4] writeback: introduce bdi_start_inode_writeback()
Date: Tue, 14 Sep 2010 15:36:52 +0200 [thread overview]
Message-ID: <20100914133652.GC4874@quack.suse.cz> (raw)
In-Reply-To: <20100913130150.138758012@intel.com>
On Mon 13-09-10 20:31:13, Wu Fengguang wrote:
> This is to transfer dirty pages encountered in page reclaim to the
> flusher threads for writeback.
>
> The flusher will piggy back more dirty pages for IO
> - it's more IO efficient
> - it helps clean more pages, a good number of them may sit in the same
> LRU list that is being scanned.
>
> To avoid memory allocations at page reclaim, a mempool is created.
>
> Background/periodic works will quit automatically, so as to clean the
> pages under reclaim ASAP. However the sync work can still block us for
> long time.
>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
> fs/fs-writeback.c | 103 +++++++++++++++++++++++++++++++++-
> include/linux/backing-dev.h | 2
> 2 files changed, 102 insertions(+), 3 deletions(-)
>
...
> +int bdi_start_inode_writeback(struct backing_dev_info *bdi,
> + struct inode *inode, pgoff_t offset)
> +{
> + struct wb_writeback_work *work;
> +
> + spin_lock_bh(&bdi->wb_lock);
> + list_for_each_entry_reverse(work, &bdi->work_list, list) {
> + unsigned long end;
> + if (work->inode != inode)
> + continue;
Hmm, this looks rather inefficient. I can imagine the list of work items
can grow rather large on memory stressed machine and the linear scan does
not play well with that (and contention on wb_lock would make it even
worse). I'm not sure how to best handle your set of intervals... RB tree
attached to an inode is an obvious choice but it seems too expensive
(memory spent for every inode) for such a rare use. Maybe you could have
a per-bdi mapping (hash table) from ino to it's tree of intervals for
reclaim... But before going for this, probably measuring how many intervals
are we going to have under memory pressure would be good.
> + end = work->offset + work->nr_pages;
> + if (work->offset - offset < WRITE_AROUND_PAGES) {
It's slightly unclear what's intended here when offset >
work->offset. Could you make that explicit?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-09-14 13:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 12:31 [PATCH 0/4] [RFC] transfer vmscan pageout works to the flusher thread Wu Fengguang
2010-09-13 12:31 ` [PATCH 1/4] writeback: integrated background work Wu Fengguang
2010-09-13 22:46 ` Minchan Kim
2010-09-14 0:53 ` Wu Fengguang
2010-09-14 12:45 ` Jan Kara
2010-09-13 12:31 ` [PATCH 2/4] writeback: quit background/periodic work when other works are enqueued Wu Fengguang
2010-09-14 12:40 ` Jan Kara
2010-11-01 12:07 ` Wu Fengguang
2010-11-01 15:08 ` Jan Kara
2010-11-01 15:13 ` Jan Kara
2010-11-01 12:14 ` [PATCH 1/2] writeback: integrated background writeback work Wu Fengguang
2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang
2010-11-01 15:22 ` Christoph Hellwig
2010-11-02 1:57 ` Minchan Kim
2010-11-05 12:15 ` Johannes Weiner
2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig
2010-11-01 20:37 ` Wu Fengguang
2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang
2010-11-02 1:55 ` Minchan Kim
2010-11-05 12:01 ` Johannes Weiner
2010-09-13 12:31 ` [PATCH 3/4] writeback: introduce bdi_start_inode_writeback() Wu Fengguang
2010-09-14 13:36 ` Jan Kara [this message]
2010-11-01 12:35 ` Wu Fengguang
2010-09-13 12:31 ` [PATCH 4/4] vmscan: transfer async file writeback to the flusher Wu Fengguang
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=20100914133652.GC4874@quack.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=riel@redhat.com \
/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).