dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH dwarves v4 0/4] Parallelize BTF type info generating of pahole
@ 2022-01-26 19:20 Kui-Feng Lee
  2022-01-26 19:20 ` [PATCH dwarves v4 1/4] dwarf_loader: Receive per-thread data on worker threads Kui-Feng Lee
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Kui-Feng Lee @ 2022-01-26 19:20 UTC (permalink / raw)
  To: dwarves, arnaldo.melo; +Cc: ast, daniel, andrii, bpf, Kui-Feng Lee

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.

V4 includes following changes.

 - Fix nits and typos.

 - Rollback to calling btf__add_btf() at the main thread to simplify
   code.  The reasons for that are additional lock making it
   complicated and doing w/o reusing btf_encoder being obvious slower.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=d81283d27266
[v1] https://lore.kernel.org/dwarves/20220120010817.2803482-1-kuifeng@fb.com/
[v2] https://lore.kernel.org/dwarves/20220124191858.1601255-1-kuifeng@fb.com/
[v3] https://lore.kernel.org/dwarves/20220126040509.1862767-1-kuifeng@fb.com/

Kui-Feng Lee (4):
  dwarf_loader: Receive per-thread data on worker threads.
  dwarf_loader: Prepare and pass per-thread data to worker threads.
  pahole: Use per-thread btf instances to avoid mutex locking.
  libbpf: Update libbpf to a new revision.

 btf_encoder.c  |  25 ++++++----
 btf_encoder.h  |   2 +
 btf_loader.c   |   4 +-
 ctf_loader.c   |   2 +-
 dwarf_loader.c |  59 ++++++++++++++++++-----
 dwarves.h      |   9 +++-
 lib/bpf        |   2 +-
 pahole.c       | 128 +++++++++++++++++++++++++++++++++++++++++++++----
 pdwtags.c      |   3 +-
 pfunct.c       |   4 +-
 10 files changed, 198 insertions(+), 40 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-03-21 21:08 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 19:20 [PATCH dwarves v4 0/4] Parallelize BTF type info generating of pahole Kui-Feng Lee
2022-01-26 19:20 ` [PATCH dwarves v4 1/4] dwarf_loader: Receive per-thread data on worker threads Kui-Feng Lee
2022-01-26 19:55   ` Andrii Nakryiko
2022-01-26 20:14     ` Kui-Feng Lee
2022-01-27 10:05     ` Arnaldo Carvalho de Melo
2022-03-08 23:45       ` Andrii Nakryiko
2022-03-09 19:24         ` Arnaldo Carvalho de Melo
2022-03-10  0:14           ` Andrii Nakryiko
2022-03-10  0:18             ` Andrii Nakryiko
2022-03-21 19:06               ` Kui-Feng Lee
2022-03-21 21:08                 ` Arnaldo Carvalho de Melo
2022-03-14 15:38             ` Arnaldo Carvalho de Melo
2022-03-14 15:43               ` Arnaldo Carvalho de Melo
2022-01-26 19:20 ` [PATCH dwarves v4 2/4] dwarf_loader: Prepare and pass per-thread data to " Kui-Feng Lee
2022-01-26 19:55   ` Andrii Nakryiko
2022-01-26 19:20 ` [PATCH dwarves v4 3/4] pahole: Use per-thread btf instances to avoid mutex locking Kui-Feng Lee
2022-01-26 19:58   ` Andrii Nakryiko
2022-01-26 20:57     ` Kui-Feng Lee
2022-01-27 10:05     ` Arnaldo Carvalho de Melo
2022-01-27 20:12     ` Arnaldo Carvalho de Melo
2022-01-28 19:50       ` Arnaldo Carvalho de Melo
2022-02-01  6:56         ` Andrii Nakryiko
2022-02-02  0:16           ` Arnaldo Carvalho de Melo
2022-01-26 19:20 ` [PATCH dwarves v4 4/4] libbpf: Update libbpf to a new revision Kui-Feng Lee
2022-01-26 19:59   ` Andrii Nakryiko

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 NNTP newsgroup(s).