On Mon, 20 Mar 2006, Balbir Singh wrote:
> When I allocate the structure - I would like to do
>
> kmem_cache_alloc_set(&resp, GFP_XXXXX, 0xEE)
>
> The device should ideally fill all fields of resp. Fields that look
> 0xEE after receiving the response -- would indicate that they were not
> filled by the device. This would be extremely useful in debugging.
> With kmem_cache_zalloc() - 0 is usually almost always a valid value.
> It is useful in some cases and no so much in other cases.
>
> I could easily achieve the same thing by doing a
>
> memset(&resp, 0xEE, size)
>
> after the kmem_cache_alloc(). But since there is an API to zero out
> allocated memory, I thought we could make it more generic and more
> useful.
Yeah, but if it's a debugging thing, I don't see much point in adding yet
another API call. The main point in introducing kmem_cache_zalloc() is to
move existing API into slab proper.
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]