Dwarves Archive mirror
 help / color / mirror / Atom feed
From: Kui-Feng Lee <kuifeng@fb.com>
To: <dwarves@vger.kernel.org>, <arnaldo.melo@gmail.com>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>,
	Kui-Feng Lee <kuifeng@fb.com>
Subject: [PATCH dwarves 0/2] Parallelize BTF type info generating of pahole
Date: Wed, 19 Jan 2022 17:08:15 -0800	[thread overview]
Message-ID: <20220120010817.2803482-1-kuifeng@fb.com> (raw)

Creating an instance of btf for each worker thread allows
steal-function provided by pahole to add type info on multiple threads
without a lock.  The main thread merges the results of worker threads
to the primary instance.

Copying data from per-thread btf instances to the primary instance is
expensive now.  However, there is a patch landed at the bpf-next
repository. [1] With the patch for bpf-next and this patch, they drop
total runtime to 5.4s from 6.0s with "-j4" on my device to generate
BTF for Linux.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=d81283d27266

Kui-Feng Lee (2):
  dwarf_loader: Prepare and pass per-thread data to worker threads.
  pahole: Use per-thread btf instances to avoid mutex locking.

 btf_encoder.c  |   5 +++
 btf_encoder.h  |   2 +
 btf_loader.c   |   2 +-
 ctf_loader.c   |   2 +-
 dwarf_loader.c |  58 ++++++++++++++++++------
 dwarves.h      |   9 +++-
 pahole.c       | 120 ++++++++++++++++++++++++++++++++++++++++++++++---
 pdwtags.c      |   3 +-
 pfunct.c       |   4 +-
 9 files changed, 180 insertions(+), 25 deletions(-)

-- 
2.30.2


             reply	other threads:[~2022-01-20  1:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  1:08 Kui-Feng Lee [this message]
2022-01-20  1:08 ` [PATCH dwarves 1/2] dwarf_loader: Prepare and pass per-thread data to worker threads Kui-Feng Lee
2022-01-20  1:08 ` [PATCH dwarves 2/2] pahole: Use per-thread btf instances to avoid mutex locking Kui-Feng Lee
2022-01-20 20:16   ` Andrii Nakryiko
2022-01-20 19:59 ` [PATCH dwarves 0/2] Parallelize BTF type info generating of pahole Andrii Nakryiko
2022-01-20 20:46   ` Arnaldo Carvalho de Melo

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=20220120010817.2803482-1-kuifeng@fb.com \
    --to=kuifeng@fb.com \
    --cc=andrii@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).