]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm, mempool: disallow mempools based on slab caches with constructors
authorDavid Rientjes <rientjes@google.com>
Tue, 7 Apr 2015 23:44:31 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:31 +0000 (09:44 +1000)
commite8a5308dc7489545baf1896fd596b641191ea3a3
tree3479259c65b75823e9c261719de5a0de3270c579
parent07542e5c336cadc939886994bce4cf56daf0a732
mm, mempool: disallow mempools based on slab caches with constructors

All occurrences of mempools based on slab caches with object constructors
have been removed from the tree, so disallow creating them.

We can only dereference mem->ctor in mm/mempool.c without including
mm/slab.h in include/linux/mempool.h.  So simply note the restriction,
just like the comment restricting usage of __GFP_ZERO, and warn on kernels
with CONFIG_DEBUG_VM() if such a mempool is allocated from.

We don't want to incur this check on every element allocation, so use
VM_BUG_ON().

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mempool.h
mm/mempool.c