Re: [RFC 2/4] CONFIG_STABLE: Switch off kmalloc(0) tests in slab allocators

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

 



Zach Brown <[email protected]> writes:

> > +#ifndef CONFIG_STABLE
> >  	/*
> >  	 * We should return 0 if size == 0 (which would result in the
> >  	 * kmalloc caller to get NULL) but we use the smallest object
> > @@ -81,6 +82,7 @@ static inline int kmalloc_index(size_t s
> >  	 * we can discover locations where we do 0 sized allocations.
> >  	 */
> >  	WARN_ON_ONCE(size == 0);
> > +#endif
> 
> > +#ifndef CONFIG_STABLE
> >  	WARN_ON_ONCE(size == 0);
> > +#endif
> 
> I wonder if there wouldn't be value in making a WARN_*() variant that
> contained the ifdef internally so we could lose these tedious
> surrounding ifdefs in call sites.  WARN_DEVELOPER_WHEN(), or something.
> I don't care what it's called.  

Networking has had NETDEBUG(codeblock) for this. Perhaps something
similar would be useful (DEVELOPMENT(codeblock)) in addition
to the special WARN/BUG_ONs

-Andi
-
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