mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
mm: introduce memdesc_zonenum()
Remove a conversion from folio to page by passing the folio->flags (which are a copy of the page->flags) to the new memdesc_zonenum() function. Link: https://lkml.kernel.org/r/20250805172307.1302730-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
eb00fdd84d
commit
4aff03fbe5
|
|
@ -1183,15 +1183,20 @@ static inline bool zone_is_empty(struct zone *zone)
|
|||
#define KASAN_TAG_MASK ((1UL << KASAN_TAG_WIDTH) - 1)
|
||||
#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
|
||||
|
||||
static inline enum zone_type memdesc_zonenum(memdesc_flags_t flags)
|
||||
{
|
||||
ASSERT_EXCLUSIVE_BITS(flags.f, ZONES_MASK << ZONES_PGSHIFT);
|
||||
return (flags.f >> ZONES_PGSHIFT) & ZONES_MASK;
|
||||
}
|
||||
|
||||
static inline enum zone_type page_zonenum(const struct page *page)
|
||||
{
|
||||
ASSERT_EXCLUSIVE_BITS(page->flags, ZONES_MASK << ZONES_PGSHIFT);
|
||||
return (page->flags.f >> ZONES_PGSHIFT) & ZONES_MASK;
|
||||
return memdesc_zonenum(page->flags);
|
||||
}
|
||||
|
||||
static inline enum zone_type folio_zonenum(const struct folio *folio)
|
||||
{
|
||||
return page_zonenum(&folio->page);
|
||||
return memdesc_zonenum(folio->flags);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ZONE_DEVICE
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user