On Fri, Apr 20, 2018 at 10:17:32AM -0500, Christopher Lameter wrote: > On Wed, 18 Apr 2018, Matthew Wilcox wrote: > > > As suggested by Kirill, make page_type a bitmask. Because it starts out > > life as -1 (thanks to sharing the storage with _mapcount), setting a > > page flag means clearing the appropriate bit. This gives us space for > > probably twenty or so extra bits (depending how paranoid we want to be > > about _mapcount underflow). > > Could we use bits in the page->flags for this? We could remove the node or > something else from page->flags. And the slab bit could also be part of > the page type. > > The page field handling gets more and more bizarre. I don't think I'm making it any more bizarre than it already is :-) Indeed, I think this patch makes it *more* sane. Before this patch, there are three magic values that might sometimes be stored in ->_mapcount. After this patch, that's split into its own field, and the magic values are actually flags, so they can be combined.