lkml.org 
[lkml]   [2023]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Re: [RFC PATCH net-next 3/3] sock: Throttle pressure-aware sockets under pressure
From
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
>>
>>

\
 
 \ /
  Last update: 2023-09-03 06:56    [W:0.043 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site