Messages in this thread | | | Subject | Re:Re:Re: [PATCH] kmalloc index optimization(add kmalloc max size check) | From | 赵军奎 <> | Date | Tue, 21 Apr 2020 10:53:49 +0800 (GMT+08:00) |
| |
发件人:Christopher Lameter <cl@linux.com> 发送日期:2020-04-20 00:42:55 收件人:"赵军奎" <bernard@vivo.com> 抄送人:Pekka Enberg <penberg@kernel.org>,David Rientjes <rientjes@google.com>,Joonsoo Kim <iamjoonsoo.kim@lge.com>,Andrew Morton <akpm@linux-foundation.org>,linux-mm@kvack.org,linux-kernel@vger.kernel.org,kernel@vivo.com 主题: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
| |