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: Glauber Costa <hidden>
Date: 2012-05-22 15:25:14

On 05/22/2012 07:08 PM, JoonSoo Kim wrote:
quoted
+#ifdef CONFIG_DEBUG_VM
quoted
 +       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
Just because slob works without a name, it doesn't mean that calling 
kmem_cache_create() without a name is even a bit close to being sane.

Any user of this interface, has no way to know which allocator will be 
used in the end. So the guarantees given by the interface should be 
sanity checked, whether or not the particular cache uses it.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help