From: Stanislav Fomichev <sdf@google.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net,
Stanislav Fomichev <sdf@google.com>
Subject: [PATCH bpf-next v5 0/3] bpf: misc performance improvements for cgroup hooks
Date: Fri, 8 Jan 2021 10:03:30 -0800 [thread overview]
Message-ID: <20210108180333.180906-1-sdf@google.com> (raw)
First patch adds custom getsockopt for TCP_ZEROCOPY_RECEIVE
to remove kmalloc and lock_sock overhead from the dat path.
Second patch removes kzalloc/kfree from getsockopt for the common cases.
Third patch switches cgroup_bpf_enabled to be per-attach to
to add only overhead for the cgroup attach types used on the system.
No visible user-side changes.
v5:
- reorder patches to reduce the churn (Martin KaFai Lau)
v4:
- update performance numbers
- bypass_bpf_getsockopt (Martin KaFai Lau)
v3:
- remove extra newline, add comment about sizeof tcp_zerocopy_receive
(Martin KaFai Lau)
- add another patch to remove lock_sock overhead from
TCP_ZEROCOPY_RECEIVE; technically, this makes patch #1 obsolete,
but I'd still prefer to keep it to help with other socket
options
v2:
- perf numbers for getsockopt kmalloc reduction (Song Liu)
- (sk) in BPF_CGROUP_PRE_CONNECT_ENABLED (Song Liu)
- 128 -> 64 buffer size, BUILD_BUG_ON (Martin KaFai Lau)
Stanislav Fomichev (3):
bpf: remove extra lock_sock for TCP_ZEROCOPY_RECEIVE
bpf: try to avoid kzalloc in cgroup/{s,g}etsockopt
bpf: split cgroup_bpf_enabled per attach type
include/linux/bpf-cgroup.h | 61 ++++++----
include/linux/filter.h | 5 +
include/net/sock.h | 2 +
include/net/tcp.h | 1 +
kernel/bpf/cgroup.c | 104 +++++++++++++++---
net/ipv4/af_inet.c | 9 +-
net/ipv4/tcp.c | 14 +++
net/ipv4/tcp_ipv4.c | 1 +
net/ipv4/udp.c | 7 +-
net/ipv6/af_inet6.c | 9 +-
net/ipv6/tcp_ipv6.c | 1 +
net/ipv6/udp.c | 7 +-
.../selftests/bpf/prog_tests/sockopt_sk.c | 22 ++++
.../testing/selftests/bpf/progs/sockopt_sk.c | 15 +++
14 files changed, 206 insertions(+), 52 deletions(-)
--
2.29.2.729.g45daf8777d-goog
next reply other threads:[~2021-01-08 18:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 18:03 Stanislav Fomichev [this message]
2021-01-08 18:03 ` [PATCH bpf-next v5 1/3] bpf: remove extra lock_sock for TCP_ZEROCOPY_RECEIVE Stanislav Fomichev
2021-01-08 18:09 ` Eric Dumazet
2021-01-08 18:26 ` Stanislav Fomichev
2021-01-08 18:40 ` Eric Dumazet
2021-01-08 19:08 ` Stanislav Fomichev
2021-01-08 19:23 ` Eric Dumazet
2021-01-08 19:26 ` Stanislav Fomichev
2021-01-08 20:08 ` Eric Dumazet
2021-01-08 18:03 ` [PATCH bpf-next v5 2/3] bpf: try to avoid kzalloc in cgroup/{s,g}etsockopt Stanislav Fomichev
2021-01-08 18:03 ` [PATCH bpf-next v5 3/3] bpf: split cgroup_bpf_enabled per attach type Stanislav Fomichev
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=20210108180333.180906-1-sdf@google.com \
--to=sdf@google.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@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 NNTP newsgroup(s).