Re: [PATCH v5 0/7] mm, slab: Make kmalloc_info[] contain all types of names

From: Pengfei Li
Date: Tue Sep 17 2019 - 09:11:58 EST


On Tue, Sep 17, 2019 at 12:04 AM Christopher Lameter <cl@xxxxxxxxx> wrote:
>
> On Mon, 16 Sep 2019, Pengfei Li wrote:
>
> > 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().
> >
> > Patch1 predefines the names of all types of kmalloc to save
> > the time spent dynamically generating names.
> >
> > These changes make sense, and the time spent by new_kmalloc_cache()
> > has been reduced by approximately 36.3%.
>
> This is time spend during boot and does not affect later system
> performance.
>

Yes.

> > Time spent by new_kmalloc_cache()
> > (CPU cycles)
> > 5.3-rc7 66264
> > 5.3-rc7+patch_1-3 42188
>
> Ok. 15k cycles during boot saved. So we save 5 microseconds during bootup?
>

Yes, this is a very small benefit.

> The current approach was created with the view on future setups allowing a
> dynamic configuration of kmalloc caches based on need. I.e. ZONE_DMA may
> not be needed once the floppy driver no longer makes use of it.

Yes, With this in mind, I also used #ifdef for INIT_KMALLOC_INFO.