[-next,9/9] mm: convert page_cpupid_reset_last() to folio_cpupid_reset_last()
Commit Message
It isn't need to fill the default cpupid value for all the struct
page, since cpupid is only used for numa balancing, and the pages
for numa balancing are all from buddy, page_cpupid_reset_last()
is already called by free_pages_prepare() to initialize it, so
let's drop the page_cpupid_reset_last() in __init_single_page(),
then make page_cpupid_reset_last() to take a folio and rename it
to folio_cpupid_reset_last().
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm.h | 10 +++++-----
mm/mm_init.c | 1 -
mm/page_alloc.c | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
@@ -1692,9 +1692,9 @@ static inline int folio_cpupid_last(struct folio *folio)
{
return folio->_last_cpupid;
}
-static inline void page_cpupid_reset_last(struct page *page)
+static inline void folio_cpupid_reset_last(struct folio *folio)
{
- page->_last_cpupid = -1 & LAST_CPUPID_MASK;
+ folio->_last_cpupid = -1 & LAST_CPUPID_MASK;
}
#else
static inline int folio_cpupid_last(struct folio *folio)
@@ -1704,9 +1704,9 @@ static inline int folio_cpupid_last(struct folio *folio)
extern int folio_cpupid_xchg_last(struct folio *folio, int cpupid);
-static inline void page_cpupid_reset_last(struct page *page)
+static inline void folio_cpupid_reset_last(struct folio *folio)
{
- page->flags |= LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT;
+ folio->flags |= LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT;
}
#endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */
@@ -1769,7 +1769,7 @@ static inline bool cpupid_pid_unset(int cpupid)
return true;
}
-static inline void page_cpupid_reset_last(struct page *page)
+static inline void folio_cpupid_reset_last(struct folio *folio)
{
}
@@ -563,7 +563,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,
set_page_links(page, zone, nid, pfn);
init_page_count(page);
page_mapcount_reset(page);
- page_cpupid_reset_last(page);
page_kasan_tag_reset(page);
INIT_LIST_HEAD(&page->lru);
@@ -1126,7 +1126,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
return false;
}
- page_cpupid_reset_last(page);
+ folio_cpupid_reset_last(folio);
page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
reset_page_owner(page, order);
page_table_check_free(page, order);