[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210513120829.GB772931@hyeyoo>
Date: Thu, 13 May 2021 21:08:29 +0900
From: Hyeonggon Yoo <42.hyeyoo@...il.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
iamjoonsoo.kim@....com, rientjes@...gle.com, penberg@...nel.org,
cl@...ux.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
42.hyeyoo@...il.com
Subject: Re: [PATCH v3] mm, slub: change run-time assertion in
kmalloc_index() to compile-time
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.
Powered by blists - more mailing lists