[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <229c6f8d-b89b-1b85-8408-089c4cdf32a9@bytedance.com>
Date: Sun, 3 Sep 2023 12:54:52 +0800
From: Abel Wu <wuyun.abel@...edance.com>
To: Simon Horman <horms@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shakeel Butt <shakeelb@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>,
Yosry Ahmed <yosryahmed@...gle.com>,
Yu Zhao <yuzhao@...gle.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Yafang Shao <laoar.shao@...il.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Martin KaFai Lau <martin.lau@...nel.org>,
Breno Leitao <leitao@...ian.org>,
Alexander Mikhalitsyn <alexander@...alicyn.com>,
David Howells <dhowells@...hat.com>,
Jason Xing <kernelxing@...cent.com>,
open list <linux-kernel@...r.kernel.org>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>
Subject: Re: Re: [RFC PATCH net-next 3/3] sock: Throttle pressure-aware
sockets under pressure
Hi Simon, thanks for reviewing!
On 9/1/23 9:59 PM, Simon Horman wrote:
> On Fri, Sep 01, 2023 at 02:21:28PM +0800, Abel Wu wrote:
>> @@ -3087,8 +3100,20 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind)
>> if (sk_has_memory_pressure(sk)) {
>> u64 alloc;
>>
>> - if (!sk_under_memory_pressure(sk))
>> + /* Be more conservative if the socket's memcg (or its
>> + * parents) is under reclaim pressure, try to possibly
>> + * avoid further memstall.
>> + */
>> + if (under_memcg_pressure)
>> + goto suppress_allocation;
>> +
>> + if (!sk_under_global_memory_pressure(sk))
>> return 1;
>> +
>> + /* Trying to be fair among all the sockets of same
>> + * protocal under global memory pressure, by allowing
>
> nit: checkpatch.pl --codespell says, protocal -> protocol
Will fix in next version.
Thanks,
Abel
>
>> + * the ones that under average usage to raise.
>> + */
>> alloc = sk_sockets_allocated_read_positive(sk);
>> if (sk_prot_mem_limits(sk, 2) > alloc *
>> sk_mem_pages(sk->sk_wmem_queued +
>> --
>> 2.37.3
>>
>>
Powered by blists - more mailing lists