From: Andi Kleen <ak@linux.intel.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: Add inline-account tool
Date: Mon, 20 Nov 2023 12:08:50 -0800 [thread overview]
Message-ID: <ZVu8u+oofXO8iwyf@tassilo> (raw)
In-Reply-To: <CAK7LNASS1YWdqW5TUXQ0iC3vgoDbUf-M-cRX0BvrkOV8HPyjxg@mail.gmail.com>
>
> > + sym_sizes = [syms[x + 1] - syms[x] for x, _ in enumerate(syms[:-1])]
> > + sym_total = sum(sym_sizes)
>
>
> This is equivalent to
>
> sym_total = syms[-1] - syms[0]
>
> isn't it?
No it's not when there are gaps in the symbols, which always happens in
the kernel. The previous version used the range but that led to inbalances.
> def get_ranges(syms, threads):
>
> ranges = []
> prev = syms[0]
> i = 1
>
> while threads > 0:
>
> boundary = prev + 1 + (syms[-1] - prev - 1) // threads
>
> while syms[i] < boundary:
> i += 1
Note the boundary is not the address, but the sum of symbol sizes
-Andi
next prev parent reply other threads:[~2023-11-20 20:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 0:49 [PATCH v2] kbuild: Add inline-account tool Andi Kleen
2023-11-19 16:32 ` Masahiro Yamada
2023-11-20 4:00 ` Masahiro Yamada
2023-11-20 20:08 ` Andi Kleen [this message]
2023-11-21 2:20 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZVu8u+oofXO8iwyf@tassilo \
--to=ak@linux.intel.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox