From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758943AbdACNeA (ORCPT ); Tue, 3 Jan 2017 08:34:00 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:35249 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758905AbdACNdH (ORCPT ); Tue, 3 Jan 2017 08:33:07 -0500 Date: Tue, 3 Jan 2017 13:33:03 +0000 From: Stefan Hajnoczi To: Jason Wang Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next V2 3/3] tun: rx batching Message-ID: <20170103133303.GC14707@stefanha-x1.localdomain> References: <1482912571-3157-1-git-send-email-jasowang@redhat.com> <1482912571-3157-4-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DIOMP1UsTsWJauNi" Content-Disposition: inline In-Reply-To: <1482912571-3157-4-git-send-email-jasowang@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 28, 2016 at 04:09:31PM +0800, Jason Wang wrote: > +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. --DIOMP1UsTsWJauNi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYa6gPAAoJEJykq7OBq3PIZ2sH/0VYpR4DPRyzYO7z6UMBZwGC gbOV4hIqlfKg3e9MWqF4ekaRGek/WuV3goEUOhXBY1gwI2NGWoowb4/wPfjCTQR0 6r6Vt78rgAsl4McgXJ6fQdH1pGgLVNZQ+/iXINjRjpFN1vYPj+vXFk0GuhDZV5ke gNmUFs2kJ2HysCJtLjB2Fuwmspmbd6jhRNmQET5ADsiZsbi9+Lm8jYME/CESkE8h gLaW1G3ECOkKDza9TkXx5wlq1GRUllpe0zqw6tGKQEPZLF0wu+PKHTru0vkKddX1 pmE9ukXVAJqxoP2XwWU8qXfNBjpPyZS9JAMzA3R5HuWJCQ+z3ASpGkIQMqRbs/Q= =kLi7 -----END PGP SIGNATURE----- --DIOMP1UsTsWJauNi--