Re: [PATCH] slub: Remove use of page->counter

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

 



On Tue, Apr 10, 2018 at 03:47:28PM -0500, Christopher Lameter wrote:
> On Tue, 10 Apr 2018, Matthew Wilcox wrote:
> 
> > In my continued attempt to clean up struct page, I've got to the point
> > where it'd be really nice to get rid of 'counters'.  I like the patch
> > below because it makes it clear when & where we're doing "weird" things
> > to access the various counters.
> 
> Well sounds good.
> 
> > struct {
> > 	unsigned long flags;
> > 	union {
> > 		struct {
> > 			struct address_space *mapping;
> > 			pgoff_t index;
> > 		};
> > 		struct {
> > 			void *s_mem;
			/* Dword boundary */
> > 			void *freelist;
> > 		};
> > 		...
> > 	};
> > 	union {
> > 		atomic_t _mapcount;
> > 		unsigned int active;
> 
> Is this aligned on a doubleword boundary? Maybe move the refcount below
> the flags field?

You need freelist and _mapcount to be in the same dword.  There's no
space to put them both in dword 0, so that's used for flags and mapping
/ s_mem.  Then freelist, mapcount and refcount are in dword 1 (on 64-bit),
or freelist & mapcount are in dword 1 on 32-bit.  After that, 32 and 64-bit
no longer line up on the same dword boundaries.




[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