]> git.karo-electronics.de Git - karo-tx-linux.git/commit
slab: ignore internal flags in cache creation
authorGlauber Costa <glommer@parallels.com>
Thu, 25 Oct 2012 01:14:52 +0000 (12:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 30 Oct 2012 04:15:14 +0000 (15:15 +1100)
commit654881e4caee945a2a7909dd513256dd7120104f
tree24e593f8475b1781d7fec61b7664110a23b8c4cf
parentdbda40431194932929fc5815e21d06ccc97173d2
slab: ignore internal flags in cache creation

Some flags are used internally by the allocators for management purposes.
One example of that is the CFLGS_OFF_SLAB flag that slab uses to mark that
the metadata for that cache is stored outside of the slab.

No cache should ever pass those as a creation flags.  We can just ignore
this bit if it happens to be passed (such as when duplicating a cache in
the kmem memcg patches).

Because such flags can vary from allocator to allocator, we allow them to
make their own decisions on that, defining SLAB_AVAILABLE_FLAGS with all
flags that are valid at creation time.  Allocators that doesn't have any
specific flag requirement should define that to mean all flags.

Common code will mask out all flags not belonging to that set.

Signed-off-by: Glauber Costa <glommer@parallels.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/slab.c
mm/slab.h
mm/slab_common.c
mm/slub.c