[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200215011505.GD7778@bombadil.infradead.org>
Date: Fri, 14 Feb 2020 17:15:05 -0800
From: Matthew Wilcox <willy@...radead.org>
To: John Hubbard <jhubbard@...dia.com>
Cc: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-erofs@...ts.ozlabs.org, linux-ext4@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, cluster-devel@...hat.com,
ocfs2-devel@....oracle.com, linux-xfs@...r.kernel.org
Subject: Re: [PATCH v5 04/13] mm: Add readahead address space operation
On Thu, Feb 13, 2020 at 09:36:25PM -0800, John Hubbard wrote:
> > +static inline struct page *readahead_page(struct readahead_control *rac)
> > +{
> > + struct page *page;
> > +
> > + if (!rac->nr_pages)
> > + return NULL;
> > +
> > + page = xa_load(&rac->mapping->i_pages, rac->start);
>
>
> Is it worth asserting that the page was found:
>
> VM_BUG_ON_PAGE(!page || xa_is_value(page), page);
>
> ? Or is that overkill here?
It shouldn't be possible since they were just added in a locked state.
If it did happen, it'll be caught by the assert below -- dereferencing
a NULL pointer or a shadow entry is not going to go well.
> > + VM_BUG_ON_PAGE(!PageLocked(page), page);
> > + rac->batch_count = hpage_nr_pages(page);
> > + rac->start += rac->batch_count;
>
> The above was surprising, until I saw the other thread with Dave and you.
> I was reviewing this patchset in order to have a chance at understanding the
> follow-on patchset ("Large pages in the page cache"), and it seems like that
> feature has a solid head start here. :)
Right, I'll document that.
Powered by blists - more mailing lists