]> 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>
Wed, 31 Oct 2012 05:49:47 +0000 (16:49 +1100)
commit7dc12d1860cc3a88407460bec3e6d1df21e3bbfc
tree1d55f4cfe3d2817bf41aaef1dbc1858e09766f56
parent181753196907a263af117bd74dc59aa71a9ceef1
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