[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aeb56c34-4549-6f05-2077-2be9594a17e4@gmail.com>
Date: Tue, 22 Jun 2021 19:49:53 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <eric.dumazet@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, willemb@...gle.com,
dsahern@...il.com, yoshfuji@...ux-ipv6.org, Dave Jones <dsj@...com>
Subject: Re: [PATCH net-next] ip: avoid OOM kills with large UDP sends over
loopback
On 6/22/21 7:19 PM, Jakub Kicinski wrote:
> On Tue, 22 Jun 2021 09:54:22 -0700 Jakub Kicinski wrote:
>>>> +static inline void sk_allocation_push(struct sock *sk, gfp_t flag, gfp_t *old)
>>>> +{
>>>> + *old = sk->sk_allocation;
>>>> + sk->sk_allocation |= flag;
>>>> +}
>>>> +
>>>
>>> This is not thread safe.
>>>
>>> Remember UDP sendmsg() does not lock the socket for non-corking sends.
>>
>> Ugh, you're right :(
>
> Hm, isn't it buggy to call sock_alloc_send_[p]skb() without holding the
> lock in the first place, then? The knee jerk fix would be to add another
> layer of specialization to the helpers:
It is not buggy. Please elaborate if you found it is.
Powered by blists - more mailing lists