From: Tim Chen <tim.c.chen@linux.intel.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrea Arcangeli <aarcange@redhat.com>,
David Rientjes <rientjes@google.com>,
Michal Hocko <mhocko@suse.cz>,
Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>,
Alex Shi <alex.shi@intel.com>,
Matthew Wilcox <willy@linux.intel.com>,
Fengguang Wu <fengguang.wu@intel.com>
Subject: Re: [PATCH 1/3 v2] mm: Batch unmapping of file mapped pages in shrink_page_list
Date: Thu, 13 Sep 2012 09:06:10 -0700 [thread overview]
Message-ID: <1347552370.9977.99.camel@schen9-DESK> (raw)
In-Reply-To: <20120911110535.GO11157@csn.ul.ie>
On Tue, 2012-09-11 at 12:05 +0100, Mel Gorman wrote:
>
> One *massive* change here that is not called out in the changelog is that
> the reclaim path now holds the page lock on multiple pages at the same
> time waiting for them to be batch unlocked in __remove_mapping_batch.
> This is suspicious for two reasons.
>
> The first suspicion is that it is expected that there are filesystems
> that lock multiple pages in page->index order and page reclaim tries to
> lock pages in a random order. You are "ok" because you trylock the pages
> but there should be a comment explaining the situation and why you're
> ok.
>
> My *far* greater concern is that the hold time for a locked page is
> now potentially much longer. You could lock a bunch of filesystem pages
> and then call pageout() on an swapcache page that takes a long time to
> write. This potentially causes a filesystem (or flusher threads etc)
> to stall on lock_page and that could cause all sorts of latency trouble.
> It will be hard to hit this bug and diagnose it but I believe it's
> there.
>
> That second risk *really* must be commented upon and ideally reviewed by
> the filesystem people. However, I very strongly suspect that the outcome
> of such a review will be a suggestion to unlock the pages and reacquire
> the lock in __remove_mapping_batch(). Bear in mind that if you take this
> approach that you *must* use trylock when reacquiring the page lock and
> handle being unable to lock the page.
>
Mel,
Thanks for your detailed comments and analysis. If I unlock the pages,
will flusher threads be the only things that will touch them? Or do I
have to worry about potentially other things done to the pages that will
make it invalid for me to unmap the pages later and put them on free
list?
Tim
next prev parent reply other threads:[~2012-09-13 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 16:19 Tim Chen
2012-09-11 2:36 ` Minchan Kim
2012-09-11 11:05 ` Mel Gorman
2012-09-13 16:06 ` Tim Chen [this message]
2012-09-14 8:56 ` Mel Gorman
2012-09-12 19:28 ` Andrew Morton
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=1347552370.9977.99.camel@schen9-DESK \
--to=tim.c.chen@linux.intel.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@intel.com \
--cc=fengguang.wu@intel.com \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=rientjes@google.com \
--cc=willy@linux.intel.com \
--cc=xiaoguangrong@linux.vnet.ibm.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
all inboxes | Powered by JetHome®