mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mm: introduce folio_is_pfmemalloc
Add a folio equivalent for page_is_pfmemalloc. This removes two instances of page_is_pfmemalloc(folio_page(folio, 0)) so the folio can be used directly. Link: https://lkml.kernel.org/r/20230106215251.599222-1-sidhartha.kumar@oracle.com Suggested-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: SeongJae Park <sj@kernel.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
17e810229c
commit
02d65d6fb1
3 changed files with 17 additions and 2 deletions
|
@ -1373,7 +1373,7 @@ static struct slab *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
|
|||
/* Make the flag visible before any changes to folio->mapping */
|
||||
smp_wmb();
|
||||
/* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */
|
||||
if (sk_memalloc_socks() && page_is_pfmemalloc(folio_page(folio, 0)))
|
||||
if (sk_memalloc_socks() && folio_is_pfmemalloc(folio))
|
||||
slab_set_pfmemalloc(slab);
|
||||
|
||||
return slab;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue