Re:Re:Re: [PATCH] kmalloc_index optimization(add kmalloc max size check)

From: èåå
Date: Mon Apr 20 2020 - 23:05:13 EST



åääïChristopher Lameter <cl@xxxxxxxxx>
åéææï2020-04-20 00:42:55
æääï"èåå" <bernard@xxxxxxxx>
æéäïPekka Enberg <penberg@xxxxxxxxxx>,David Rientjes <rientjes@xxxxxxxxxx>,Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>,Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>,linux-mm@xxxxxxxxx,linux-kernel@xxxxxxxxxxxxxxx,kernel@xxxxxxxx
äéïRe:Re: [PATCH] kmalloc_index optimization(add kmalloc max size check)>On Sat, 18 Apr 2020, èåå wrote:
>
>> Sorry for the misunderstanding.
>
>What misunderstanding?
There is no gap now.
>
>> But the current code is not, kmalloc_index will only be BUG() when it exceeds 64M.
>
>Yes that is what you may want to fix as I said.

>You could modify that to check for KMALLOC_MAX_SIZE with some more
>conditionals but then kmalloc_index) is written so that the compiler gets
>constant folding right.
For this point, I am afraid i didn`t catch your idea.
I am not sure how to modify it....
Is there some similar code implementation in the kernelï

BR//bernard