From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj5C8-0000uS-Is for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:35:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tj5C4-0000Rf-Hh for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:35:08 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:54794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj5C4-0000Pr-DZ for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:35:04 -0500 Received: by mail-ie0-f174.google.com with SMTP id c11so3585741ieb.19 for ; Thu, 13 Dec 2012 01:35:03 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50C9A142.8070603@redhat.com> Date: Thu, 13 Dec 2012 10:34:58 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1354925118-23061-1-git-send-email-keith.busch@intel.com> <50C37FF9.9090904@suse.de> <50C5D735.8070902@redhat.com> <50C99C0C.80704@redhat.com> In-Reply-To: <50C99C0C.80704@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] NVMe: Initial commit to add an NVM Express device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , qemu-devel , Keith Busch , "Busch, Keith" , Hannes Reinecke , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 13/12/2012 10:12, Kevin Wolf ha scritto: >>> There seems to be an issue with the bdrv_aio_[readv/writev] >>> routines. I added some additional tracing in the block and >>> coroutine code, and well, long story short, the coroutine >>> "bdrv_co_io_em" needs to call "qemu_coroutine_yield" before his >>> aio callback "bdrv_co_io_em_complete" invokes >>> "qemu_coroutine_enter". It does not always win this race in my >>> experiments, and qemu aborts with a recursive re-entry error. I >>> don't know this coroutine code well enough to propose a fix -- >>> I'd say maybe use locks but I think that defeats the purpose of >>> using coroutines if I understand them correctly? > > The block layer, like most other qemu functions, is supposed to run > under the qemu_global_mutex (also called BQL). Do you call into it > from a different thread that doesn't take this lock? Yes, that's the main problem. Paolo