Thread (27 messages) 27 messages, 4 authors, 2012-06-01

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

From: Pekka Enberg <penberg@kernel.org>
Date: 2012-05-31 07:52:35

On Wed, 30 May 2012, Christoph Lameter wrote:
On Wed, 30 May 2012, Pekka Enberg wrote:
quoted
quoted
 /*
+ * 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help