From: Martin KaFai Lau Date: Thu, 16 Oct 2025 19:15:10 +0000 (-0700) Subject: Merge branch 'bpf-allow-opt-out-from-sk-sk_prot-memory_allocated' X-Git-Tag: v6.19-rc1~170^2~356^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03de843bd0806184505f1e8099ff4ca9a8665dbb;p=thirdparty%2Fkernel%2Flinux.git Merge branch 'bpf-allow-opt-out-from-sk-sk_prot-memory_allocated' Kuniyuki Iwashima says: ==================== 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/20250920000751.2091731-1-kuniyu@google.com/ 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/20251007001120.2661442-1-kuniyu@google.com/ ==================== Link: https://patch.msgid.link/20251014235604.3057003-1-kuniyu@google.com Signed-off-by: Martin KaFai Lau --- 03de843bd0806184505f1e8099ff4ca9a8665dbb