diff options
| author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-11-25 21:01:47 +0000 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-01-13 22:40:34 -0800 |
| commit | 9aec2fb0fd5ed3b90665a9a289fff7fa7a6e1fc7 (patch) | |
| tree | 82e4c28573c3b9118908982810b8148aa5ab35c4 /mm/slub.c | |
| parent | 642975242e328620ac136d6e02aceb253e9ee460 (diff) | |
| download | linux-next-9aec2fb0fd5ed3b90665a9a289fff7fa7a6e1fc7.tar.gz linux-next-9aec2fb0fd5ed3b90665a9a289fff7fa7a6e1fc7.zip | |
slab: allocate frozen pages
Since slab does not use the page refcount, it can allocate and free frozen
pages, saving one atomic operation per free.
Link: https://lkml.kernel.org/r/20241125210149.2976098-16-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
| -rw-r--r-- | mm/slub.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/slub.c b/mm/slub.c index c2151c9fee22..cef25d9a476a 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2420,9 +2420,9 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node, unsigned int order = oo_order(oo); if (node == NUMA_NO_NODE) - folio = (struct folio *)alloc_pages(flags, order); + folio = (struct folio *)alloc_frozen_pages(flags, order); else - folio = (struct folio *)__alloc_pages_node(node, flags, order); + folio = (struct folio *)__alloc_frozen_pages(flags, order, node, NULL); if (!folio) return NULL; @@ -2656,7 +2656,7 @@ static void __free_slab(struct kmem_cache *s, struct slab *slab) __folio_clear_slab(folio); mm_account_reclaimed_pages(pages); unaccount_slab(slab, order, s); - __free_pages(&folio->page, order); + free_frozen_pages(&folio->page, order); } static void rcu_free_slab(struct rcu_head *h) |
