lkml.org 
[lkml]   [2019]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Remove redundant test from find_get_pages_contig
On Tue, Jan 08, 2019 at 01:26:49PM -0800, Andrew Morton wrote:
> On Tue, 8 Jan 2019 12:26:35 -0800 Matthew Wilcox <willy@infradead.org> wrote:
>
> > > Would it be excessively cautious to put a WARN_ON_ONCE() in there for a
> > > while?
> >
> > I think it would ... it'd get in the way of a subsequent patch to store
> > only head pages in the page cache.
>
> OK, shall grab. Perhaps the changelog could gain a few words
> explaining the history, etc.

Yeah, I suck at changelogs. Particularly when I've encountered something
that's distracting me from the thing I was trying to do. How about this:

mm: Remove redundant test from find_get_pages_contig

After we establish a reference on the page, we check the pointer
continues to be in the correct position in i_pages. Checking page->index
afterwards is unnecessary; if it were to change, then the pointer to it
from the page cache would also move. The check used to be done before
grabbing a reference on the page which was racy (see 9cbb4cb21b19f
("mm: find_get_pages_contig fixlet")), but nobody noticed that moving
the check after grabbing the reference was redundant.

Signed-off-by: Matthew Wilcox <willy@infradead.org>

\
 
 \ /
  Last update: 2019-01-08 22:36    [W:0.080 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site