On Thu, 2022-09-22 at 18:29 +0200, Paolo Abeni wrote:
On Wed, 2022-09-21 at 14:44 -0700, Alexander Duyck wrote:
quoted
On Wed, Sep 21, 2022 at 1:52 PM Paolo Abeni [off-list ref] wrote:
quoted
In that case we will still duplicate a bit of code -
this_cpu_ptr(&napi_alloc_cache) on both branches. gcc 11.3.1 here says
that the generated code is smaller without this change.
Why do you need to duplicate it?
The goal was using a single local variable to track the napi cache and
the memory info. I thought ("was sure") that keeping two separate
variables ('nc' and 'page_frag' instead of 'nc' and 'pfmemalloc') would
produce the same amount of code. gcc says I'm wrong and you are right
;)
I'll use that in v2, thanks!
I'm sorry for being so noisy lately. I've to take back the above.
Before I measured the code size with for debug builds. With non debug
build the above schema does not reduce the instructions number.
I'll share the code after some more testing.
Cheers,
Paolo