Re: Common 06/22] Extract common fields from struct kmem_cache

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


On Wed, 30 May 2012, Christoph Lameter wrote:

> 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.

Works for me.

			Pekka

[Site Home]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

Add to Google Google PageRank Checking tool