Thread (46 messages) 46 messages, 4 authors, 2012-06-29

Re: [RFC] Common code 04/12] slabs: Extract common code for kmem_cache_create

From: Christoph Lameter <hidden>
Date: 2012-05-22 17:49:50

On Wed, 23 May 2012, JoonSoo Kim wrote:
2012/5/19 Christoph Lameter [off-list ref]:
quoted
This patch has the effect of adding sanity checks for SLUB and SLOB
under CONFIG_DEBUG_VM and removes the checks in SLAB for !CONFIG_DEBUG_VM.
If !CONFIG_DEBUG_VM,
code for sanity checks remain in __kmem_cache_create in slab.c, doesn't it?
Some sanity checks remain after this patch and are moved later.
quoted
+#ifdef CONFIG_DEBUG_VM
+       if (!name || in_interrupt() || size < sizeof(void *) ||
+               size > KMALLOC_MAX_SIZE) {
+               printk(KERN_ERR "kmem_cache_create(%s) integrity check"
+                       " failed\n", name);
+               goto out;
+       }
+#endif
Currently, when !CONFIG_DEBUG_VM, name check is handled differently in
sl[aou]bs.
slob worked with !name, but slab, slub return NULL.
So I think some change is needed for name handling.
Right. All should check for !name and fail on that.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help