mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-19 12:00:00 +00:00
mm/sl{a,u}b: fix wrong usages of folio_page() for getting head pages
The standard idiom for getting head page of a given folio is '&folio->page', but some are wrongly using 'folio_page(folio, 0)' for the purpose. Fix those to use the idiom. Suggested-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: SeongJae Park <sj@kernel.org> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
parent
35e3c36d43
commit
c034c6a45c
@ -1386,7 +1386,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct slab *slab)
|
||||
|
||||
BUG_ON(!folio_test_slab(folio));
|
||||
__slab_clear_pfmemalloc(slab);
|
||||
page_mapcount_reset(folio_page(folio, 0));
|
||||
page_mapcount_reset(&folio->page);
|
||||
folio->mapping = NULL;
|
||||
/* Make the mapping reset visible before clearing the flag */
|
||||
smp_wmb();
|
||||
@ -1395,7 +1395,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct slab *slab)
|
||||
if (current->reclaim_state)
|
||||
current->reclaim_state->reclaimed_slab += 1 << order;
|
||||
unaccount_slab(slab, order, cachep);
|
||||
__free_pages(folio_page(folio, 0), order);
|
||||
__free_pages(&folio->page, order);
|
||||
}
|
||||
|
||||
static void kmem_rcu_free(struct rcu_head *head)
|
||||
|
@ -2066,7 +2066,7 @@ static void __free_slab(struct kmem_cache *s, struct slab *slab)
|
||||
if (current->reclaim_state)
|
||||
current->reclaim_state->reclaimed_slab += pages;
|
||||
unaccount_slab(slab, order, s);
|
||||
__free_pages(folio_page(folio, 0), order);
|
||||
__free_pages(&folio->page, order);
|
||||
}
|
||||
|
||||
static void rcu_free_slab(struct rcu_head *h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user