On Wed, 30 May 2012, Pekka Enberg wrote: > > /* > > + * Common fields provided in kmem_cache by all slab allocators > > + */ > > +#define SLAB_COMMON \ > > + unsigned int size, align; \ > > + unsigned long flags; \ > > + const char *name; \ > > + int refcount; \ > > + void (*ctor)(void *); \ > > + struct list_head list; > > + > > I don't like this at all - it obscures the actual "kmem_cache" > structures. If we can't come up with a reasonable solution that makes > this a proper struct that's embedded in allocator-specific > "kmem_cache" structures, it's best that we rename the fields but keep > them inlined and drop this macro.. Actually that is a good idea. We can keep a fake struct in comments around in slab.h to document what all slab allocators have to support and then at some point we may be able to integrate the struct.