On Fri, 4 May 2018, Matthew Wilcox wrote: > So you'd rather have one union that's used for slab/slob/slub? Like this? Yup that looks better. > > struct { /* slab, slob and slub */ > union { > struct list_head slab_list; > struct { /* Partial pages */ > struct page *next; > #ifdef CONFIG_64BIT > int pages; /* Nr of pages left */ > int pobjects; /* Approximate count */ > #else > short int pages; > short int pobjects; > #endif > }; > }; > struct kmem_cache *slab_cache; > /* Double-word boundary */ > void *freelist; /* first free object */ > union { > void *s_mem; /* first object (slab only) */ > unsigned long counters; /* slub */ > struct { > unsigned inuse:16; > unsigned objects:15; > unsigned frozen:1; > }; > }; > }; >