[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180718.141559.1076017531577697883.davem@davemloft.net>
Date: Wed, 18 Jul 2018 14:15:59 +0900 (KST)
From: David Miller <davem@...emloft.net>
To: willemdebruijn.kernel@...il.com
Cc: baoyou.xie@...il.com, willemb@...gle.com, viro@...iv.linux.org.uk,
gregkh@...uxfoundation.org, pombredanne@...b.com,
tklauser@...tanz.ch, matthew@...systems.ca, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] datagram: return from __skb_recv_datagram() as soon
as possible
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Date: Mon, 16 Jul 2018 15:17:54 -0700
> If the above occurs, that implies that the queue is not empty so the
> next iteration of the loop in __skb_recv_datagram should return
> the oldest packet on the queue.
Isn't it possible, with two threads pulling from the socket in
parallel, for one of them to be constantly unable to pass that
test:
if (sk->sk_receive_queue.prev != skb)
goto out;
because the other one empties the queue too quickly every time?
We sample 'last' with the queue lock held, but the above test is done
without that lock.
Powered by blists - more mailing lists