From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Hugh Dickins <hughd@google.com>
Cc: Nick Piggin <npiggin@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
Wu Fengguang <fengguang.wu@intel.com>,
Salman Qazi <sqazi@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: don't return 0 too early from find_get_pages()
Date: Thu, 24 Feb 2011 13:40:13 +0100 [thread overview]
Message-ID: <1298551213.2428.43.camel@twins> (raw)
In-Reply-To: <alpine.LSU.2.00.1102232132080.2239@sister.anvils>
On Wed, 2011-02-23 at 21:35 -0800, Hugh Dickins wrote:
> Callers of find_get_pages(), or its wrapper pagevec_lookup() - notably
> truncate_inode_pages_range() - stop looking further when it returns 0.
>
> But if an interrupt comes just after its radix_tree_gang_lookup_slot(),
> especially if we have preemptible RCU enabled, isn't it conceivable
> that all 14 pages returned could be removed from the page cache by
> shrink_page_list(), before find_get_pages() gets to process them? So
> causing it to return 0 although there may be plenty more pages beyond.
>
> Make find_get_pages() and find_get_pages_tag() check for this unlikely
> case, and restart should it occur; but callers of find_get_pages_contig()
> have no such expectation, it's okay for that to return 0 early.
>
> I have not seen this in practice, just worried by the possibility.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2011-02-24 12:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-24 5:35 [PATCH] mm: don't return 0 too early from find_get_pages() Hugh Dickins
2011-02-24 12:40 ` Peter Zijlstra [this message]
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=1298551213.2428.43.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@kernel.dk \
--cc=sqazi@google.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).