mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: William Kucharski <[email protected]> Cc: Hyeonggon Yoo <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Miaohe Lin <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
1 parent
642975242e
commit
9aec2fb0fd
1 file changed
+3
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user