Received: from eggs.gnu.org ([2001:4830:134:3::10]:46872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhJqQ-0006yd-0c for qemu-devel@nongnu.org; Tue, 06 Sep 2016 13:07:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhJqO-0005Rq-8I for qemu-devel@nongnu.org; Tue, 06 Sep 2016 13:07:32 -0400 Date: Tue, 6 Sep 2016 19:07:23 +0200 From: Kevin Wolf Message-ID: <20160906170723.GJ4667@noname.redhat.com> References: <20160829171021.4902-1-pbutsykin@virtuozzo.com> <20160829171021.4902-6-pbutsykin@virtuozzo.com> <20160901152813.GE6355@noname.redhat.com> <57CEF4DE.9030901@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57CEF4DE.9030901@virtuozzo.com> Subject: Re: [Qemu-devel] [PATCH RFC v2 05/22] block/pcache: add aio requests into cache List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Butsykin Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com, eblake@redhat.com, famz@redhat.com Am 06.09.2016 um 18:54 hat Pavel Butsykin geschrieben: > >>+ *out_node = found; > >>+ return false; > >>+ } > >>+ atomic_add(&s->pcache.curr_size, new_node->cm.nb_sectors); > > > >atomic_add() implies that you have concurrent threads. I don't see any. > > > Yeah, but what about iothread? Doesn't presence of iothread lead to > parallel handling of requests in multiple threads? No, it doesn't. We're running under the AioContext lock. If we were actually running in parallel threads, your locks might also be needed, but then they would have to be real thread locks instead of coroutine locks. But it doesn't happen today, so I think it's best to ignore. Kevin