From: Matthew Wilcox (Oracle) Date: Tue, 2 Jun 2020 04:46:54 +0000 (-0700) Subject: mm: document why we don't set PageReadahead X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2d8163e4899dad92175eedd1c2326c875eaa74fa;p=linux.git mm: document why we don't set PageReadahead If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski Cc: Chao Yu Cc: Cong Wang Cc: Darrick J. Wong Cc: Dave Chinner Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: John Hubbard Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Johannes Thumshirn Cc: Miklos Szeredi Link: http://lkml.kernel.org/r/20200414150233.24495-15-willy@infradead.org Signed-off-by: Linus Torvalds --- diff --git a/mm/readahead.c b/mm/readahead.c index ae231a5312cbe..73cb59ed5cffd 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -195,9 +195,12 @@ void page_cache_readahead_unbounded(struct address_space *mapping, if (page && !xa_is_value(page)) { /* - * Page already present? Kick off the current batch of - * contiguous pages before continuing with the next - * batch. + * Page already present? Kick off the current batch + * of contiguous pages before continuing with the + * next batch. This page may be the one we would + * have intended to mark as Readahead, but we don't + * have a stable reference to this page, and it's + * not worth getting one just for that. */ read_pages(&rac, &page_pool, true); continue;