[lkml]   [2019]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names
On 9/3/19 6:04 PM, Pengfei Li wrote:
> There are three types of kmalloc, KMALLOC_NORMAL, KMALLOC_RECLAIM
> The name of KMALLOC_NORMAL is contained in kmalloc_info[].name,
> but the names of KMALLOC_RECLAIM and KMALLOC_DMA are dynamically
> generated by kmalloc_cache_name().
> This patch predefines the names of all types of kmalloc to save
> the time spent dynamically generating names.

As I said, IMHO it's more useful that we don't need to allocate the
names dynamically anymore, and it's simpler overall.

> Signed-off-by: Pengfei Li <>

Acked-by: Vlastimil Babka <>

> /*
> * kmalloc_info[] is to make slub_debug=,kmalloc-xx option work at boot time.
> * kmalloc_index() supports up to 2^26=64MB, so the final entry of the table is
> * kmalloc-67108864.
> */
> const struct kmalloc_info_struct kmalloc_info[] __initconst = {

BTW should it really be an __initconst, when references to the names
keep on living in kmem_cache structs? Isn't this for data that's
discarded after init?

 \ /
  Last update: 2019-09-09 17:00    [W:0.108 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site