]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
readahead: use folio_nr_pages() instead of shift operation
authorChi Zhiling <chizhiling@kylinos.cn>
Thu, 10 Jul 2025 06:04:51 +0000 (14:04 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:53 +0000 (18:59 -0700)
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 <chizhiling@kylinos.cn>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/readahead.c

index 95a24f12d1e7f2363e1133b14781454004c900ad..406756d343092fb1ce6a868facfcc9f92379fd2d 100644 (file)
@@ -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;
                /*