[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+651SOZDegASE2XQ7BViBdS=gdGPuNs=69SBS7SuKitg@mail.gmail.com>
Date: Tue, 26 Nov 2024 19:41:28 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Fernando Fernandez Mancera <ffmancera@...eup.net>
Cc: netdev@...r.kernel.org, willemb@...gle.com
Subject: Re: [PATCH net] udp: call sock_def_readable() if socket is not SOCK_FASYNC
On Tue, Nov 26, 2024 at 7:32 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Tue, Nov 26, 2024 at 6:56 PM Fernando Fernandez Mancera
> <ffmancera@...eup.net> wrote:
> >
> > If a socket is not SOCK_FASYNC, sock_def_readable() needs to be called
> > even if receive queue was not empty. Otherwise, if several threads are
> > listening on the same socket with blocking recvfrom() calls they might
> > hang waiting for data to be received.
> >
>
> SOCK_FASYNC seems completely orthogonal to the issue.
>
> First sock_def_readable() should wakeup all threads, I wonder what is happening.
Oh well, __skb_wait_for_more_packets() is using
prepare_to_wait_exclusive(), so in this case sock_def_readable() is
waking only one thread.
>
> UDP can store incoming packets into sk->sk_receive_queue and
> udp_sk(sk)->reader_queue
>
> Paolo, should __skb_wait_for_more_packets() for UDP socket look at both queues ?
Powered by blists - more mailing lists