diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-12-28 08:57:46 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-01-05 10:17:46 -0800 |
commit | 82feeaa0092523c309d8d4dd6d67237d1b1a1b45 (patch) | |
tree | 499787080de04debb8d655e17a4a7f41f402e33f /mm | |
parent | 2443fb5bec4ff1dda4670e47ceb9ef8c05a06412 (diff) |
slub: use a folio in __kmalloc_large_node
Mirror the code in free_large_kmalloc() and alloc_pages_node() and use a
folio directly. Avoid the use of folio_alloc() as that will set up an
rmappable folio which we do not want here.
Link: https://lkml.kernel.org/r/20231228085748.1083901-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 66f0b3531800..c4a7507df321 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1137,7 +1137,7 @@ gfp_t kmalloc_fix_flags(gfp_t flags) static void *__kmalloc_large_node(size_t size, gfp_t flags, int node) { - struct page *page; + struct folio *folio; void *ptr = NULL; unsigned int order = get_order(size); @@ -1145,10 +1145,10 @@ static void *__kmalloc_large_node(size_t size, gfp_t flags, int node) flags = kmalloc_fix_flags(flags); flags |= __GFP_COMP; - page = alloc_pages_node(node, flags, order); - if (page) { - ptr = page_address(page); - mod_lruvec_page_state(page, NR_SLAB_UNRECLAIMABLE_B, + folio = (struct folio *)alloc_pages_node(node, flags, order); + if (folio) { + ptr = folio_address(folio); + lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B, PAGE_SIZE << order); } |