From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZdEp-0000WB-3t for qemu-devel@nongnu.org; Thu, 11 Jan 2018 08:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZdEm-00034Y-HW for qemu-devel@nongnu.org; Thu, 11 Jan 2018 08:49:47 -0500 References: <20180110091846.10699-1-famz@redhat.com> <20180110091846.10699-4-famz@redhat.com> <20180110183304.GE24212@stefanha-x1.localdomain> From: Paolo Bonzini Message-ID: Date: Thu, 11 Jan 2018 14:48:41 +0100 MIME-Version: 1.0 In-Reply-To: <20180110183304.GE24212@stefanha-x1.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 3/9] block: Add VFIO based NVMe driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Fam Zheng Cc: qemu-devel@nongnu.org, Keith Busch , qemu-block@nongnu.org, Kevin Wolf , Max Reitz , Eric Blake , Markus Armbruster , Karl Rister On 10/01/2018 19:33, Stefan Hajnoczi wrote: >> + >> + /* Fields protected by @lock */ > Does this lock serve any purpose? I didn't see a place where these > fields is accessed from multiple threads. Perhaps you're trying to > prepare for multiqueue, but then other things like the > BDRVNVMeState->inflight counter aren't protected so it doesn't make > sense. > Other drivers are already thread safe (e.g. block/vdi.c since commit 1e88663979, "vdi: make it thread-safe", 2017-07-17). So I'd be in favor of (fixing and) keeping the lock. Paolo