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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]