lkml.org 
[lkml]   [2022]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] bitmap changes for v6.0-rc1
On Mon, Oct 10, 2022 at 8:09 PM Yury Norov <yury.norov@gmail.com> wrote:
>
> > So I _think_ all the nr_cpu_id's games are mainly because we don't
> > want to allocate huge arrays when you can't actually have that many
> > CPU's - but for a small NR_CPUS situation that just isn't an issue
> > anyway.
> >
> > Yes? No?
>
> You're talking about .data section. FORCE_NR_CPUS is about .text and
> code generation.

No, it's more than just code size that you compare.

It's also the "walk over big arrays".

It doesn't matter if the *code* is simpler, if it's a fixed walk over
64 long-words because the code uses a fixed 4096-bit bitmap.

Yes, that constant 64 is simpler than loading a variable, but it's not
*better*. It's worse. It has allocated more memory, and then it wastes
time walking over it.

So just looking at code size and "simplicity" is bogus.

Yes, a constant loop is smaller and simpler, but unless the constant
is also *small*, it sure isn't better.

Linus

\
 
 \ /
  Last update: 2022-10-11 05:21    [W:0.592 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site