[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874iucro57.fsf@linux.dev>
Date: Tue, 12 Aug 2025 18:44:36 -0700
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Neal Cardwell
<ncardwell@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Willem de
Bruijn <willemb@...gle.com>, Matthieu Baerts <matttbe@...nel.org>, Mat
Martineau <martineau@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>, Shakeel Butt <shakeel.butt@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>, Michal Koutný
<mkoutny@...e.com>, Tejun Heo <tj@...nel.org>, Simon Horman
<horms@...nel.org>, Geliang Tang <geliang@...nel.org>, Muchun Song
<muchun.song@...ux.dev>, Mina Almasry <almasrymina@...gle.com>, Kuniyuki
Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org,
mptcp@...ts.linux.dev, cgroups@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 net-next 06/12] net-memcg: Introduce
mem_cgroup_from_sk().
Kuniyuki Iwashima <kuniyu@...gle.com> writes:
> We will store a flag in the lowest bit of sk->sk_memcg.
>
> Then, directly dereferencing sk->sk_memcg will be illegal, and we
> do not want to allow touching the raw sk->sk_memcg in many places.
>
> Let's introduce mem_cgroup_from_sk().
>
> Other places accessing the raw sk->sk_memcg will be converted later.
>
> Note that we cannot define the helper as an inline function in
> memcontrol.h as we cannot access any fields of struct sock there
> due to circular dependency, so it is placed in sock.h.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Acked-by: Roman Gushchin <roman.gushchin@...ux.dev>
Powered by blists - more mailing lists