On Wed, May 23, 2012 at 11:34 PM, Christoph Lameter <cl@xxxxxxxxx> wrote: > Define "COMMON" to include definitions for fields used in all > slab allocators. After that it will be possible to share code that > only operates on those fields of kmem_cache. > > The patch basically takes the slob definition of kmem cache and > uses the field namees for the other allocators. > > The slob definition of kmem_cache is moved from slob.c to slob_def.h > so that the location of the kmem_cache definition is the same for > all allocators. > > Reviewed-by: Glauber Costa <glommer@xxxxxxxxxxxxx> > Reviewed-by: Joonsoo Kim <js1304@xxxxxxxxx> > Signed-off-by: Christoph Lameter <cl@xxxxxxxxx> > > --- > include/linux/slab.h | 11 +++++++++++ > include/linux/slab_def.h | 8 ++------ > include/linux/slob_def.h | 4 ++++ > include/linux/slub_def.h | 11 ++++------- > mm/slab.c | 30 +++++++++++++++--------------- > mm/slob.c | 7 ------- > 6 files changed, 36 insertions(+), 35 deletions(-) > > Index: linux-2.6/include/linux/slab.h > =================================================================== > --- linux-2.6.orig/include/linux/slab.h 2012-05-22 09:05:49.416464029 -0500 > +++ linux-2.6/include/linux/slab.h 2012-05-23 04:23:21.423024939 -0500 > @@ -93,6 +93,17 @@ > (unsigned long)ZERO_SIZE_PTR) > > /* > + * 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.. -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href