发件人: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