Skip to contentSkip to conversation

mm-readahead-limit-page-cache-size-in-page_cache_ra_order.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Jul 4, 2024 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/readahead: limit page cache size in page_cache_ra_order()
has been removed from the -mm tree. Its filename was
mm-readahead-limit-page-cache-size-in-page_cache_ra_order.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Gavin Shan <[email protected]>
Subject: mm/readahead: limit page cache size in page_cache_ra_order()
Date: Thu, 27 Jun 2024 10:39:50 +1000

In page_cache_ra_order(), the maximal order of the page cache to be allocated shouldn't be larger than MAX_PAGECACHE_ORDER. Otherwise, it's possible the large page cache can't be supported by xarray when the corresponding xarray entry is split.

For example, HPAGE_PMD_ORDER is 13 on ARM64 when the base page size is 64KB. The PMD-sized page cache can't be supported by xarray.

Fixes 793917d997df ("mm/readahead: Add large folio readahead")
Cc Darrick J. Wong <[email protected]>
Cc Don Dutile <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc William Kucharski <[email protected]>
Cc Zhenyu Zhang <[email protected]>
Cc <[email protected]> [5.18+]

---

 mm/readahead.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mm/readahead.c renamed from mm/readahead.c~mm-readahead-limit-page-cache-size-in-page_cache_ra_order +4 -4
@@ -503,11 +503,11 @@ void page_cache_ra_order(struct readahea
 
 	limit = min(limit, index + ra->size - 1);
 
-	if (new_order < MAX_PAGECACHE_ORDER) {
+	if (new_order < MAX_PAGECACHE_ORDER)
 		new_order += 2;
-		new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order);
-		new_order = min_t(unsigned int, new_order, ilog2(ra->size));
-	}
+
+	new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order);
+	new_order = min_t(unsigned int, new_order, ilog2(ra->size));
 
 	/* See comment in page_cache_ra_unbounded() */
 	nofs = memalloc_nofs_save();

_

Patches currently in -mm which might be from [email protected] are