From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35981 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PORBG-0004V9-MH for qemu-devel@nongnu.org; Fri, 03 Dec 2010 03:39:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PORBF-0002cJ-CF for qemu-devel@nongnu.org; Fri, 03 Dec 2010 03:39:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PORBF-0002cE-0h for qemu-devel@nongnu.org; Fri, 03 Dec 2010 03:39:49 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB38dmpj014017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Dec 2010 03:39:48 -0500 Message-ID: <4CF8AD12.3070105@redhat.com> Date: Fri, 03 Dec 2010 09:40:50 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate References: <20101129153718.GA2494@redhat.com> <19701.57573.766694.450729@gargle.gargle.HOWL> <20101201055902.GA9199@redhat.com> In-Reply-To: <20101201055902.GA9199@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Jason Wang , mtosatti@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com Am 01.12.2010 06:59, schrieb Michael S. Tsirkin: > On Wed, Dec 01, 2010 at 01:45:09PM +0800, Jason Wang wrote: >> Michael S. Tsirkin writes: >> > Avoid sending out packets, and modifying >> > device state, when VM is stopped. >> > Add assert statements to verify this does not happen. >> > >> > Avoid scheduling bh when vhost-net is started. >> > >> > Stop bh when driver disabled bus mastering >> > (we must not access memory after this). >> > >> > Signed-off-by: Michael S. Tsirkin >> > >> >> There's no need to disable it bh we call qemu_aio_flush() after >> vm_state_notify() in do_vm_stop(). > > Yes, but bh can resubmit itself, so flush is not enough. > Note that vm stop is not the only reason to avoid > running bh: when vhost-net is enabled we should avoid it too. > Makes sense? If I understand correctly, qemu_aio_flush() is supposed to also execute the resubmitted BH, so that you really end up with an empty BH list. Kevin