All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: daniel@iogearbox.net, ast@kernel.org, andrii@kernel.org
Cc: bpf@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH bpf-next v3 0/3] bpf: remove the cgroup -> bpf header dependecy
Date: Tue, 14 Dec 2021 22:19:13 -0800	[thread overview]
Message-ID: <20211215061916.715513-1-kuba@kernel.org> (raw)

Changes to bpf.h tend to clog up our build systems. The netdev/bpf
build bot does incremental builds to save time (reusing the build
directory to only rebuild changed objects).

This is the rough breakdown of how many objects needs to be rebuilt
based on file touched:

kernel.h      40633
bpf.h         17881
bpf-cgroup.h  17875
skbuff.h      10696
bpf-netns.h    7604
netdevice.h    7452
filter.h       5003
tcp.h          4048
sock.h         4959

As the stats show touching bpf.h is _very_ expensive.

Bulk of the objects get rebuilt because MM includes cgroup headers.
Luckily bpf-cgroup.h does not fundamentally depend on bpf.h so we
can break that dependency and reduce the number of objects.

With the patches applied touching bpf.h causes 5019 objects to be rebuilt
(17881 / 5019 = 3.56x). That's pretty much down to filter.h plus noise.

v2:
Try to make the new headers wider in scope. Collapse bpf-link and
bpf-cgroup-types into one header, which may serve as "BPF kernel
API" header in the future if needed. Rename bpf-cgroup-storage.h
to bpf-inlines.h.

Add a fix for the s390 build issue.

v3:
Merge bpf-includes.h into bpf.h.
Remember to git format-patch after fixing build issues.

Jakub Kicinski (3):
  add includes masked by cgroup -> bpf dependency
  bpf: add header for enum bpf_cgroup_storage_type and bpf_link
  bpf: remove the cgroup -> bpf header dependecy

 arch/s390/mm/hugetlbpage.c       |  1 +
 include/linux/bpf-cgroup-types.h | 29 +++++++++++++++++++++++++++++
 include/linux/bpf-cgroup.h       | 12 ++----------
 include/linux/bpf.h              | 27 ++++++++++-----------------
 4 files changed, 42 insertions(+), 27 deletions(-)
 create mode 100644 include/linux/bpf-cgroup-types.h

-- 
2.31.1


             reply	other threads:[~2021-12-15  6:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  6:19 Jakub Kicinski [this message]
2021-12-15  6:19 ` [PATCH bpf-next v3 1/3] add includes masked by cgroup -> bpf dependency Jakub Kicinski
2021-12-15  6:19 ` [PATCH bpf-next v3 2/3] bpf: add header for enum bpf_cgroup_storage_type and bpf_link Jakub Kicinski
2021-12-15  6:19 ` [PATCH bpf-next v3 3/3] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski

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=20211215061916.715513-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.