Messages in this thread | | | Date | Sun, 18 Dec 2005 22:41:37 +0200 | From | Pekka Enberg <> | Subject | Re: 2.6.16-rc5-mm2 - kzalloc() considered harmful for debugging. |
| |
Hi Valdis,
On 12/18/05, Valdis.Kletnieks@vt.edu <Valdis.Kletnieks@vt.edu> 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |