On Thu, May 13, 2021 at 01:37:38PM +0200, Vlastimil Babka wrote: > > See my suggestion below that builds on Andrew's size_is_constant but > > would retain the old interface and support testing. > > I can accept that, but please also modify/expand the newly added comment. Now > it's *normally* evaluated in compile-time. And there should be warning that > anyone calling it with size_is_constant == false should do that only in context > where performance (and code bloat, most likely too) doesn't matter, such as unit > test. > > Thanks, Vlastimil > > > Thanks, I completely agree on what Vlastimil said. there should be comment saying that generally you should not use kmalloc_index with size_is_const == true. and the caller MUST guarantee that size_is_const is correct. if not, it would be so confusing.