Re: [RFC 1/4] kevent: core files.

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

 



On Sun, Jul 09, 2006 at 05:59:42PM +0300, Pekka Enberg ([email protected]) wrote:
> On 7/9/06, Evgeniy Polyakov <[email protected]> wrote:
> >+struct kevent *kevent_alloc(gfp_t mask)
> >+{
> >+       struct kevent *k;
> >+
> >+       if (kevent_cache)
> >+               k = kmem_cache_alloc(kevent_cache, mask);
> >+       else
> >+               k = kzalloc(sizeof(struct kevent), mask);
> >+
> >+       return k;
> >+}
> 
> What's this for? Why would kevent_cache be NULL? Note that you can use
> kmem_cache_zalloc() for fixed size allocations that need to be zeroed.

It can work without cache at all, i.e. if cache creation fails.
Well, it can be removed of course, since it does not hurt anything.

> On 7/9/06, Evgeniy Polyakov <[email protected]> wrote:
> >+
> >+void kevent_free(struct kevent *k)
> >+{
> >+       memset(k, 0xab, sizeof(struct kevent));
> 
> Why is slab poisoning not sufficient?

Since that pointer is always known to be poisoned no matter if kernel
debugging option is turned on or off.

-- 
	Evgeniy Polyakov
-
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