Re: [PATCH v2] mm: Split page_type out from _map_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 09, 2018 at 10:43:19AM -0800, Dave Hansen wrote:
> On 02/09/2018 07:28 AM, Matthew Wilcox wrote:
> >  	union {
> > +		/*
> > +		 * If the page is neither PageSlab nor PageAnon, the value
> > +		 * stored here may help distinguish it from page cache pages.
> > +		 * See page-flags.h for a list of page types which are
> > +		 * currently stored here.
> > +		 */
> > +		unsigned int page_type;
> > +
> >  		_slub_counter_t counters;
> >  		unsigned int active;		/* SLAB */
> >  		struct {			/* SLUB */
> 
> Are there any straightforward rules that we can enforce here?  For
> instance, if you are using "page_type", you can never have PG_lru set.
> 
> Not that we have done this at all for 'struct page' historically, it
> would be really convenient to have a clear definition for when
> "page_type" is valid vs. "_mapcount".

I agree, it'd be nice.  I think the only invariant we can claim to be
true is that if PageSlab is set then page_type is not valid.  There are
probably any number of bits in the page->flags that aren't currently in
use by any of the consumers who actually set page_type, but I don't feel
like there's a straightforward rule that we can enforce.  Maybe they'll
want to start using them in the future for their own purposes.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux