On 05/22/2012 07:08 PM, JoonSoo Kim wrote:
+#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
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@xxxxxxxxx. 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@xxxxxxxxx"> email@xxxxxxxxx </a>