mbox series

[0/8] PageFlags cleanups

Message ID 20240227192337.757313-1-willy@infradead.org (mailing list archive)
Headers show
Series PageFlags cleanups | expand

Message

Matthew Wilcox Feb. 27, 2024, 7:23 p.m. UTC
We have now successfully removed all of the uses of some of the PageFlags
from the kernel, but there's nothing to stop somebody reintroducing them.
By splitting out FOLIO_FLAGS from PAGEFLAGS, we can stop defining the
old flags; and we do that in some of the later patches.

After doing this, I realised that dump_page() was living dangerously;
we could end up calling folio_test_foo() on a pointer which no longer
pointed to a folio (as dump_page() is not necessarily called when the
caller has a reference to the page).  So I fixed that up.

And then I realised that this was the key to making dump_page() take
a const argument, which means we can constify the page flags testing,
which means we can remove more cast-away-the-const bad code.

And here's where I ended up.

Matthew Wilcox (Oracle) (8):
  mm: Separate out FOLIO_FLAGS from PAGEFLAGS
  mm: Remove PageWaiters, PageSetWaiters and PageClearWaiters
  mm: Remove PageYoung and PageIdle definitions
  mm: Add __dump_folio()
  mm: Make dump_page() take a const argument
  mm: Constify testing page/folio flags
  mm: Constify more page/folio tests
  mm: Remove cast from page_to_nid()

 include/linux/mm.h         |   6 +-
 include/linux/mmdebug.h    |   2 +-
 include/linux/page-flags.h | 153 +++++++++++++++++++++----------------
 mm/debug.c                 | 122 ++++++++++++++++-------------
 mm/hugetlb.c               |   4 +-
 5 files changed, 161 insertions(+), 126 deletions(-)