Let me quickly give couple of high level comments. On Mon, Sep 08, 2025 at 10:34:34PM +0000, Kuniyuki Iwashima wrote: > Some protocols (e.g., TCP, UDP) have their own memory accounting for > socket buffers and charge memory to global per-protocol counters such > as /proc/net/ipv4/tcp_mem. > > When running under a non-root cgroup, Remove this non-root cgroup as we may change in future to also associate with root memcg for stat purpose. In addition, we may switch sk pointing to objcg instead of memcg. > this memory is also charged to > the memcg as sock in memory.stat. > > We do not need to pay costs for two orthogonal memory accounting > mechanisms. > > This series allows decoupling memcg from the global memory accounting > (memcg + tcp_mem -> memcg) if socket is configured as such by BPF prog. > I understand that you need fine grained control but I see more users interested in system level settings i.e. either through config, boot param or sysctl, let the user/admin disable protocol specific accounting if memcg is enabled. Please rename SK_BPF_MEMCG_SOCK_ISOLATED to something more appropriate. The isolated word is giving wrong impression. We want something which specify that the kernel is only doing memcg accounting and not protocol specific accounting for this socket. So, something like SK_BPF_MEMCG_ONLY make more sense.