[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230924072816.6ywgoe7ab2max672@google.com>
Date: Sun, 24 Sep 2023 07:28:16 +0000
From: Shakeel Butt <shakeelb@...gle.com>
To: Abel Wu <wuyun.abel@...edance.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Breno Leitao <leitao@...ian.org>,
Alexander Mikhalitsyn <alexander@...alicyn.com>,
David Howells <dhowells@...hat.com>,
Jason Xing <kernelxing@...cent.com>,
Xin Long <lucien.xin@...il.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujtsu.com>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 2/2] sock: Fix improper heuristic on raising memory
On Fri, Sep 22, 2023 at 06:10:06PM +0800, Abel Wu wrote:
[...]
>
> After a second thought, it is still vague to me about the position
> the memcg pressure should be in socket memory allocation. It lacks
> convincing design. I think the above hunk helps, but not much.
>
> I wonder if we should take option (3) first. Thoughts?
>
Let's take a step further. Let's decouple the memcg accounting and
global skmem accounting. __sk_mem_raise_allocated is already very hard
to reason. There are couple of heuristics in it which may or may not
apply to both accounting infrastructures.
Let's explicitly document what heurisitics allows to forcefully succeed
the allocations i.e. irrespective of pressure or over limit for both
accounting infras. I think decoupling them would make the flow of the
code very clear.
There are three heuristics:
1. minimum buffer size even under pressure.
2. allow allocation for a socket whose usage is below average of the
system.
3. socket is over its sndbuf.
Let's discuss which heuristic applies to which accounting infra and
under which state (under pressure or over limit).
thanks,
Shakeel
Powered by blists - more mailing lists