Thread (38 messages) 38 messages, 6 authors, 2020-03-19
STALE2302d
Revisions (7)
  1. v6 [diff vs current]
  2. v6 [diff vs current]
  3. v7 [diff vs current]
  4. v8 current
  5. v9 [diff vs current]
  6. v10 [diff vs current]
  7. v11 [diff vs current]

[PATCH v8 14/25] mm: Document why we don't set PageReadahead

From: Matthew Wilcox <willy@infradead.org>
Date: 2020-02-25 21:49:58
Also in: linux-btrfs, linux-f2fs-devel, linux-fsdevel, linux-mm, linux-xfs, lkml, ocfs2-devel
Subsystem: memory management, page cache, the rest · Maintainers: Andrew Morton, Matthew Wilcox, Jan Kara, Linus Torvalds

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

If the page is already in cache, we don't set PageReadahead on it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/readahead.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/mm/readahead.c b/mm/readahead.c
index 8ee9036fd681..0afb55a49909 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;
-- 
2.25.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help