Re: 2.6.16-rc5-mm2 - kzalloc() considered harmful for debugging.

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

 



Hi Valdis,

On 12/18/05, [email protected] <[email protected]> wrote:
> Blargh.  It's tempting to do something like this in include/linux/slab.h:
>
> #ifdef CONFIG_SLAB_DEBUG
> static inline void* kzalloc(size_t size, gfp_t flags)
> {
>         void *ret = kmalloc(size, flags);
>         if (ret)
>                 memset(ret, 0, size);
>         return ret;
> }
> #else
> extern void *kzalloc(size_t, gfp_t);
> #end

I don't see CONFIG_SLAB_DEBUG in 2.6.15-rc5-mm2. Is it an external patch?

> or maybe some ad-crock macro implementation, just so the actual calling site of
> kmalloc is recorded, rather than losing the caller of kzalloc.

I would prefer this. Both kzalloc and kstrdup should override the call
site of kmalloc. Preferably, all of them should use something like
__kmalloc_tracked() and pass the call site as an parameter.

                          Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux