Re: [PATCH v3 08/14] mm: Combine first three unions in struct page

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

 



On Thu, Apr 19, 2018 at 03:46:42PM +0200, Vlastimil Babka wrote:
> > +		struct {	/* slab and slob */
> > +			struct kmem_cache *slab_cache;
> > +			void *freelist;		/* first free object */
> > +			void *s_mem;		/* first object */
> > +		};
> > +		struct {	/* slub also uses some of the slab fields */
> > +			struct kmem_cache *slub_cache;
> > +			/* Double-word boundary */
> > +			void *slub_freelist;
> 
> Is slub going to switch to use those? Or maybe this is an overkill and
> we could merge the two sl*b structs and just have an union for s_mem and
> the 3 counters?

It ends up looking pretty cruddy if you do that:

		struct {
			union {
				struct list_head slab_list;
				struct {
					struct page *next;
					unsigned int pobjects;
					unsigned int pages;
				};
			};
			struct kmem_cache *slab_cache;
			void *freelist;		/* first free object */
			union {
				void *s_mem;		/* first object */
				struct {
					unsigned inuse:16;
					unsigned objects:15;
					unsigned frozen:1;
				};
			};
		};

At least I don't enjoy the five layers of indentation ...




[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