From c809579374f47c8273eaf22a40674ae547f39254 Mon Sep 17 00:00:00 2001 From: Chi Zhiling Date: Thu, 10 Jul 2025 14:04:51 +0800 Subject: [PATCH] readahead: use folio_nr_pages() instead of shift operation folio_nr_pages() is faster helper function to get the number of pages when NR_PAGES_IN_LARGE_FOLIO is enabled. Link: https://lkml.kernel.org/r/20250710060451.3535957-1-chizhiling@163.com Signed-off-by: Chi Zhiling Acked-by: David Hildenbrand Reviewed-by: Ryan Roberts Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton --- mm/readahead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/readahead.c b/mm/readahead.c index 95a24f12d1e7f..406756d343092 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -649,7 +649,7 @@ void page_cache_async_ra(struct readahead_control *ractl, * Ramp up sizes, and push forward the readahead window. */ expected = round_down(ra->start + ra->size - ra->async_size, - 1UL << folio_order(folio)); + folio_nr_pages(folio)); if (index == expected) { ra->start += ra->size; /* -- 2.47.2