[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJuCfpF8qyEA9sfh9-kkiNdPVCJegD7affA3HJeUtgTeqxW-aQ@mail.gmail.com>
Date: Tue, 4 Feb 2025 10:14:10 -0800
From: Suren Baghdasaryan <surenb@...gle.com>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: akpm@...ux-foundation.org, kent.overstreet@...ux.dev, vbabka@...e.cz,
rostedt@...dmis.org, peterz@...radead.org, yuzhao@...gle.com,
minchan@...gle.com, souravpanda@...gle.com, pasha.tatashin@...een.com,
00107082@....com, quic_zhenhuah@...cinc.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] alloc_tag: uninline code gated by
mem_alloc_profiling_key in page allocator
On Mon, Feb 3, 2025 at 4:47 PM Shakeel Butt <shakeel.butt@...ux.dev> wrote:
>
> On Sat, Feb 01, 2025 at 03:18:02PM -0800, Suren Baghdasaryan wrote:
> > When a sizable code section is protected by a disabled static key, that
> > code gets into the instruction cache even though it's not executed and
> > consumes the cache, increasing cache misses. This can be remedied by
> > moving such code into a separate uninlined function.
> > On a Pixel6 phone, page allocation profiling overhead measured with
> > CONFIG_MEM_ALLOC_PROFILING=y and profiling disabled is:
> >
> > baseline modified
> > Big core 4.93% 1.53%
> > Medium core 4.39% 1.41%
> > Little core 1.02% 0.36%
> >
> > This improvement comes at the expense of the configuration when profiling
> > gets enabled, since there is now an additional function call. The overhead
> > from this additional call on Pixel6 is:
> >
> > Big core 0.24%
> > Middle core 0.63%
> > Little core 1.1%
> >
> > However this is negligible when compared with the overall overhead of the
> > memory allocation profiling when it is enabled.
> > On x86 this patch does not make noticeable difference because the overhead
> > with mem_alloc_profiling_key disabled is much lower (under 1%) to start
> > with, so any improvement is less visible and hard to distinguish from the
> > noise. The overhead from additional call when profiling is enabled is also
> > within noise levels.
> >
> > Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
>
> Reviewed-by: Shakeel Butt <shakeel.butt@...ux.dev>
>
> One question: Is there any plan to enable MEM_ALLOC_PROFILING by default
> in future?
It's left up to each distribution. In Android Common Kernel we are
enabling it with CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT=n and
allow vendors to enable it using kernel command line parameters.
>
Powered by blists - more mailing lists