From: Simon Horman <simon.horman@corigine.com>
To: Abel Wu <wuyun.abel@bytedance.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Glauber Costa <glommer@parallels.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/4] sock: Fix misuse of sk_under_memory_pressure()
Date: Mon, 22 May 2023 14:50:17 +0200 [thread overview]
Message-ID: <ZGtlCdQwKw3tr58f@corigine.com> (raw)
In-Reply-To: <20230522070122.6727-3-wuyun.abel@bytedance.com>
On Mon, May 22, 2023 at 03:01:20PM +0800, Abel Wu wrote:
> The status of global socket memory pressure is updated when:
>
> a) __sk_mem_raise_allocated():
>
> enter: sk_memory_allocated(sk) > sysctl_mem[1]
> leave: sk_memory_allocated(sk) <= sysctl_mem[0]
>
> b) __sk_mem_reduce_allocated():
>
> leave: sk_under_memory_pressure(sk) &&
> sk_memory_allocated(sk) < sysctl_mem[0]
>
> So the conditions of leaving global pressure are inconstant, which
> may lead to the situation that one pressured net-memcg prevents the
> global pressure from being cleared when there is indeed no global
> pressure, thus the global constrains are still in effect unexpectedly
> on the other sockets.
>
> This patch fixes this by ignoring the net-memcg's pressure when
> deciding whether should leave global memory pressure.
>
> Fixes: e1aab161e013 ("socket: initial cgroup code")
really pedantic nit:
Fixes: e1aab161e013 ("socket: initial cgroup code.")
> Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>
...
next prev parent reply other threads:[~2023-05-22 12:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 7:01 [PATCH v2 0/4] sock: Improve condition on sockmem pressure Abel Wu
2023-05-22 7:01 ` [PATCH v2 1/4] sock: Always take memcg pressure into consideration Abel Wu
2023-05-22 7:01 ` [PATCH v2 2/4] sock: Fix misuse of sk_under_memory_pressure() Abel Wu
2023-05-22 12:50 ` Simon Horman [this message]
2023-05-22 7:01 ` [PATCH v2 3/4] sock: Consider memcg pressure when raising sockmem Abel Wu
2023-05-22 12:53 ` Simon Horman
2023-05-25 1:22 ` Shakeel Butt
2023-05-29 11:58 ` Abel Wu
2023-05-29 21:12 ` Shakeel Butt
2023-05-30 9:58 ` Abel Wu
2023-05-22 7:01 ` [PATCH v2 4/4] sock: Remove redundant cond of memcg pressure Abel Wu
2023-05-22 12:54 ` Simon Horman
2023-05-23 3:04 ` Abel Wu
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=ZGtlCdQwKw3tr58f@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=glommer@parallels.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wuyun.abel@bytedance.com \
/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).