Re: [PATCH v7 09/28] mm: Create FolioFlags
From: Matthew Wilcox
Date: Mon Apr 19 2021 - 09:57:28 EST
On Mon, Apr 19, 2021 at 03:25:46PM +0200, Peter Zijlstra wrote:
> On Fri, Apr 09, 2021 at 07:50:46PM +0100, Matthew Wilcox (Oracle) wrote:
> > These new functions are the folio analogues of the PageFlags functions.
> > If CONFIG_DEBUG_VM_PGFLAGS is enabled, we check the folio is not a tail
> > page at every invocation. Note that this will also catch the PagePoisoned
> > case as a poisoned page has every bit set, which would include PageTail.
> >
> > This saves 1727 bytes of text with the distro-derived config that
> > I'm testing due to removing a double call to compound_head() in
> > PageSwapCache().
>
> I vote for dropping the Camels if we're going to rework all this.
I'm open to that. It's a bit of rework now, but easier to do it as
part of this than as a separate series.
So, concretely:
PageReferences() becomes folio_referenced()
SetPageReferenced() becomes folio_set_referenced()
ClearPageReferenced() becomes folio_clear_referenced()
__SetFolioReferenced() becomes __folio_set_referenced()
__ClearFolioReferenced() becomes __folio_clear_referenced()
TestSetPageReferenced() becomes folio_test_set_referenced()
TestClearPageReferenced() becomes folio_test_clear_referenced()
We do have some functions already like set_page_writeback(), but I
think those can become folio_set_writeback() without doing any harm.
We also have page_is_young(), page_is_pfmemalloc(), page_is_guard(),
etc. Should it be folio_referenced()? or folio_is_referenced()?