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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 23 May 2012, JoonSoo Kim wrote:

> 2012/5/19 Christoph Lameter <cl@xxxxxxxxx>:
> > 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.

>
> > +#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.


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]