All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, willemb@google.com,
	dsahern@gmail.com, yoshfuji@linux-ipv6.org,
	Dave Jones <dsj@fb.com>
Subject: Re: [PATCH net-next] ip: avoid OOM kills with large UDP sends over loopback
Date: Tue, 22 Jun 2021 19:49:53 +0200	[thread overview]
Message-ID: <aeb56c34-4549-6f05-2077-2be9594a17e4@gmail.com> (raw)
In-Reply-To: <20210622101952.28839d7e@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>



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.



  reply	other threads:[~2021-06-22 17:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 23:13 [PATCH net-next] ip: avoid OOM kills with large UDP sends over loopback Jakub Kicinski
2021-06-22 10:07 ` Paolo Abeni
2021-06-22 16:57   ` Jakub Kicinski
2021-06-22 14:12 ` Eric Dumazet
2021-06-22 16:54   ` Jakub Kicinski
2021-06-22 17:19     ` Jakub Kicinski
2021-06-22 17:49       ` Eric Dumazet [this message]
2021-06-22 17:48     ` Eric Dumazet
2021-06-22 18:09       ` Jakub Kicinski
2021-06-22 18:47         ` Eric Dumazet
2021-06-22 19:04           ` Jakub Kicinski
2021-06-22 19:51             ` Jakub Kicinski

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=aeb56c34-4549-6f05-2077-2be9594a17e4@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsj@fb.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.