From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhfqT-0004uQ-Hw for qemu-devel@nongnu.org; Wed, 07 Sep 2016 12:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhfqP-0002AG-Cd for qemu-devel@nongnu.org; Wed, 07 Sep 2016 12:37:05 -0400 References: <20160829171021.4902-1-pbutsykin@virtuozzo.com> <20160829171021.4902-6-pbutsykin@virtuozzo.com> <20160901152813.GE6355@noname.redhat.com> <57CEF4DE.9030901@virtuozzo.com> <20160906170723.GJ4667@noname.redhat.com> From: Pavel Butsykin Message-ID: <57D03EA2.3020002@virtuozzo.com> Date: Wed, 7 Sep 2016 19:21:54 +0300 MIME-Version: 1.0 In-Reply-To: <20160906170723.GJ4667@noname.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit 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: Kevin Wolf 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 On 06.09.2016 20:07, Kevin Wolf wrote: > 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. Yes, you're right. For some reason I thought that there is such a possibility :) > 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. I agree, use coroutine locks to protect the data was a bad idea. > Kevin >