From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Masahiro Yamada <masahiroy@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [GIT pull] perf/urgent for 5.7-rc2
Date: Wed, 22 Apr 2020 13:56:59 +0200 [thread overview]
Message-ID: <20200422115659.GF20730@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200422074512.GA19309@gmail.com>
On Wed, Apr 22, 2020 at 09:45:12AM +0200, Ingo Molnar wrote:
>
> * Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Mon, Apr 20, 2020 at 09:48:45AM +0200, Ingo Molnar wrote:
> > > Fortunately, much of what objtool does against vmlinux.o can be
> > > parallelized in a rather straightforward fashion I believe, if we build
> > > with -ffunction-sections.
> >
> > So that FGKASLR is going to get us -ffunction-sections, but
> > parallelizing objtool isn't going to be trivial, it's data structures
> > aren't really build for that, esp. decode_instructions() which actively
> > generates data.
> >
> > Still, it's probably doable.
>
> So AFAICS in the narrow code section I identified as the main overhead,
> only the instruction hash needs threading, i.e. this step:
>
> hash_add(file->insn_hash, &insn->hash, insn->offset);
> list_add_tail(&insn->list, &file->insn_list);
>
> Objtool can still be single-threaded before and after generating the
> instruction hash.
>
> 99% of the overhead within decode_instructions() is in
> arch_decode_instruction(), which is fully thread-safe AFAICS.
Correct; I suppose you can farm out the sections to N threads for
arch_decode_instruction() and then have the main thread collect decoded
sections and frob them in the global data structures.
Another pass you can probably parallize fairly easily is
validate_functions() / validate_unwind_hints(). While that modifies
state, the state it modifies should be local to the section at hand.
That needs an audit of course, but it should be entirely doable.
next prev parent reply other threads:[~2020-04-22 11:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 13:56 [GIT pull] core/urgent for 5.7-rc2 Thomas Gleixner
2020-04-19 13:56 ` [GIT pull] irq/urgent " Thomas Gleixner
2020-04-19 19:20 ` pr-tracker-bot
2020-04-19 13:56 ` [GIT pull] perf/urgent " Thomas Gleixner
2020-04-19 18:56 ` Linus Torvalds
2020-04-19 20:07 ` Josh Poimboeuf
2020-04-20 7:48 ` Ingo Molnar
2020-04-20 8:27 ` Peter Zijlstra
2020-04-22 7:45 ` Ingo Molnar
2020-04-22 11:56 ` Peter Zijlstra [this message]
2020-04-20 16:51 ` Linus Torvalds
2020-04-20 17:40 ` Peter Zijlstra
2020-04-20 18:17 ` Josh Poimboeuf
2020-04-20 19:17 ` Peter Zijlstra
2020-04-20 19:21 ` Linus Torvalds
2020-04-20 19:36 ` Josh Poimboeuf
2020-04-19 19:20 ` pr-tracker-bot
2020-04-19 13:56 ` [GIT pull] sched/urgent " Thomas Gleixner
2020-04-19 19:20 ` pr-tracker-bot
2020-04-19 13:56 ` [GIT pull] timers/urgent " Thomas Gleixner
2020-04-19 19:20 ` pr-tracker-bot
2020-04-19 13:56 ` [GIT pull] x86/urgent " Thomas Gleixner
2020-04-19 19:20 ` pr-tracker-bot
2020-04-19 19:20 ` [GIT pull] core/urgent " pr-tracker-bot
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=20200422115659.GF20730@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@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