bpf: Allow opt-out from sk->sk_prot->memory_allocated.
Status from this message: Applied. Thanks.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 3 repliesApplied 6/6
- v16 patches 12 repliesSuperseded
Changes in v2 from the cover letter
* Patch 2:
* Fill kdoc for skc_bypass_prot_mem
* Patch 6
* Fix server fd leak in tcp_create_sockets()
* Avoid close(0) in check_bypass()
Patches in v2 All 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | tcp: Save lock_sock() for memcg in inet_csk_accept().net/ net/ | +22 | 0 replies | Applied |
| 2/6 | net: Allow opt-out from global protocol memory accounting.include/ include/ include/ +5 more | +48 | 0 replies | Applied |
| 3/6 | net: Introduce net.core.bypass_prot_mem sysctl.Documentation/ include/ net/ +1 more | +23 | 0 replies | Applied |
| 4/6 | bpf: Support bpf_setsockopt() for BPF_CGROUP_INET_SOCK_CREATE.net/ | +48 | 0 replies | Applied |
| 5/6 | bpf: Introduce SK_BPF_BYPASS_PROT_MEM.include/ net/ tools/ | +34 | 1 reply | Applied |
| 6/6 | selftest: bpf: Add test for sk->sk_bypass_prot_mem.tools/ tools/ | +393 | 2 replies | Applied |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Shakeel Butt | Roman Gushchin | Eric Dumazet |
|---|---|---|---|
| 1/6 | R-b | A-b | R-b |
| 2/6 | R-b | A-b | R-b |
| 3/6 | R-b | A-b | R-b |
| 4/6 | A-b | ||
| 5/6 | A-b | ||
| 6/6 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 bpf-next/net 0/6] bpf: Allow opt-out from sk->sk_prot->memory_allocated.
This series allows opting out of the global per-protocol memory accounting if socket is configured as such by sysctl or BPF prog.
This series is the successor of the series below [0], but the changes now fall in net and bpf subsystems only.
I discussed with Roman Gushchin offlist, and he suggested not mixing two independent subsystems and it would be cleaner not to depend on memcg.
So, sk->sk_memcg and memcg code are no longer touched, and instead we use another hole near sk->sk_prot to store a flag for the pure net opt-out feature.
Overview of the series:
patch 1 is misc cleanup
patch 2 allows opt-out from sk->sk_prot->memory_allocated patch 3 introduces net.core.bypass_prot_mem
patch 4 & 5 supports flagging sk->sk_bypass_prot_mem via bpf_setsockopt() patch 6 is selftest
Thank you very much for all your help, Shakeel, Roman, Martin, and Eric!
[0]: https://lore.kernel.org/bpf/[email protected]/
Changes:
v2:
* Patch 2:
* Fill kdoc for skc_bypass_prot_mem
* Patch 6
* Fix server fd leak in tcp_create_sockets()
* Avoid close(0) in check_bypass()
v1: https://lore.kernel.org/bpf/[email protected]/
Kuniyuki Iwashima (6):
tcp: Save lock_sock() for memcg in inet_csk_accept().
net: Allow opt-out from global protocol memory accounting.
net: Introduce net.core.bypass_prot_mem sysctl.
bpf: Support bpf_setsockopt() for BPF_CGROUP_INET_SOCK_CREATE.
bpf: Introduce SK_BPF_BYPASS_PROT_MEM.
selftest: bpf: Add test for sk->sk_bypass_prot_mem.
Documentation/admin-guide/sysctl/net.rst | 8 + include/net/netns/core.h | 1 + include/net/proto_memory.h | 3 + include/net/sock.h | 3 + include/net/tcp.h | 3 + include/uapi/linux/bpf.h | 2 + net/core/filter.c | 79 +++++ net/core/sock.c | 37 ++- net/core/sysctl_net_core.c | 9 + net/ipv4/af_inet.c | 22 ++ net/ipv4/inet_connection_sock.c | 25 -- net/ipv4/tcp.c | 3 +- net/ipv4/tcp_output.c | 7 +- net/mptcp/protocol.c | 7 +- net/tls/tls_device.c | 3 +- tools/include/uapi/linux/bpf.h | 1 + .../bpf/prog_tests/sk_bypass_prot_mem.c | 289 ++++++++++++++++++ .../selftests/bpf/progs/sk_bypass_prot_mem.c | 104 +++++++ 18 files changed, 568 insertions(+), 38 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/sk_bypass_prot_mem.c create mode 100644 tools/testing/selftests/bpf/progs/sk_bypass_prot_mem.c
Signature · 1 line
2.51.0.788.g6d19910ace-goog