]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm/mm/percpu-km: drop nth_page() usage within single allocation
authorDavid Hildenbrand <david@redhat.com>
Mon, 1 Sep 2025 15:03:35 +0000 (17:03 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Sep 2025 21:22:04 +0000 (14:22 -0700)
We're allocating a higher-order page from the buddy.  For these pages
(that are guaranteed to not exceed a single memory section) there is no
need to use nth_page().

Link: https://lkml.kernel.org/r/20250901150359.867252-15-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/percpu-km.c

index fe31aa19db81aaed16df9049286a65f3befe2543..4efa74a495cb6bb1c42550ebc3a8b7a6f9eadf18 100644 (file)
@@ -69,7 +69,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp)
        }
 
        for (i = 0; i < nr_pages; i++)
-               pcpu_set_page_chunk(nth_page(pages, i), chunk);
+               pcpu_set_page_chunk(pages + i, chunk);
 
        chunk->data = pages;
        chunk->base_addr = page_address(pages);