Re: [PATCH 08/14] lib/Kconfig: introduce FAST_PATH option

Yury Norov
2021-02-18T19:53:59Z

On Thu, Feb 18, 2021 at 05:15:43PM +0200, Andy Shevchenko wrote:
> On Wed, Feb 17, 2021 at 08:05:06PM -0800, Yury Norov wrote:
> > This series introduces fast paths for find_bit() routines. It is
> > beneficial for typical systems, but those who limited in I-cache
> > may be concerned about increasing the .text size of the Image.
> >
> > To address this concern, one can disable FAST_PATH option in the config
> > and some save memory.
> >
> > The effect of this option on my arm64 next-20210217 build is:
>
> (Maybe bloat-o-meter will give better view on this, i.e. more human-readable)

Never heard about this tool, thanks for the hint.

scripts/bloat-o-meter vmlinux vmlinux.new
add/remove: 16/13 grow/shrink: 111/439 up/down: 3616/-19352 (-15736)
Function old new delta
find_next_bit.constprop - 220 +220
apply_wqattrs_cleanup - 176 +176
memcg_free_shrinker_maps - 172 +172
...
cpuset_hotplug_workfn 2584 2288 -296
task_numa_fault 3640 3320 -320
kmem_cache_free_bulk 1684 1280 -404
Total: Before=26085140, After=26069404, chg -0.06%

The complete output is here:
https://pastebin.com/kBSdVJcK

So if I understand the output correctly, the size of .text is decreased...
Looks weird, but if it's true, we don't need the FAST_BIT config at all
because there's no tradeoff, and I should drop the patch.

Hmm...

> > +config FAST_PATH
>
> I think the name is to broad for this cases, perhaps BITS_FAST_PATH? or BITMAP?

My logic was that since SMALL_CONST() is global, and FAST_PATH
controls the SMALL_CONST, it should also be global. I believe,
Linux should have a global switch to control the behaviour in
such cases, similarly to -Os compiler option. And I was surprized
when I found nothing like FAST_PATH in the config.

What about having FAST_PATH as a global option, and later if someone
will request for granularity, we'll introduce nested configs?

> > + bool "Enable fast path code generation"
> > + default y
> > + help
> > + This option enables fast path optimization with the cost of increasing
> > + the text section.
>
> --
> With Best Regards,
> Andy Shevchenko
>