Thread (11 messages) 11 messages, 3 authors, 2017-01-05

Re: [PATCH net-next V2 3/3] tun: rx batching

From: Jason Wang <jasowang@redhat.com>
Date: 2017-01-04 03:04:19
Also in: kvm, lkml, virtualization


On 2017年01月03日 21:33, Stefan Hajnoczi wrote:
On Wed, Dec 28, 2016 at 04:09:31PM +0800, Jason Wang wrote:
quoted
+static int tun_rx_batched(struct tun_file *tfile, struct sk_buff *skb,
+			  int more)
+{
+	struct sk_buff_head *queue = &tfile->sk.sk_write_queue;
+	struct sk_buff_head process_queue;
+	int qlen;
+	bool rcv = false;
+
+	spin_lock(&queue->lock);
Should this be spin_lock_bh()?  Below and in tun_get_user() there are
explicit local_bh_disable() calls so I guess BHs can interrupt us here
and this would deadlock.
sk_write_queue were accessed only in this function which runs under 
process context, so no need for spin_lock_bh() here.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help