From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMu9H-000787-Q2 for qemu-devel@nongnu.org; Fri, 20 Sep 2013 02:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMu98-00071m-Ld for qemu-devel@nongnu.org; Fri, 20 Sep 2013 02:25:03 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:48154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMu97-00071M-UP for qemu-devel@nongnu.org; Fri, 20 Sep 2013 02:24:54 -0400 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Sep 2013 11:54:50 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id CB082394004E for ; Fri, 20 Sep 2013 11:54:31 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8K6Qs3A45744130 for ; Fri, 20 Sep 2013 11:56:54 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8K6OjgV007727 for ; Fri, 20 Sep 2013 11:54:45 +0530 Message-ID: <523BEA2C.7050204@linux.vnet.ibm.com> Date: Fri, 20 Sep 2013 14:24:44 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1377589765-30215-1-git-send-email-xiawenc@linux.vnet.ibm.com> <20130918140318.GE25444@stefanha-thinkpad.redhat.com> In-Reply-To: <20130918140318.GE25444@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 0/3] move global bdrv_states out of block.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On 09/18/2013 10:03 PM, Stefan Hajnoczi wrote: > On Tue, Aug 27, 2013 at 03:49:22PM +0800, Wenchao Xia wrote: >> In order to support multiple caller from different thread, global >> inside block layer should be carefully treated. bdrv_states represent >> a group of bds* which is now used by qemu, so it is a user concept which >> should be managed by user. This series tries to move it out, so later >> different thread can feed the API with its own bds* group. >> >> This is a RFC series which does not completely convert the API, the missing >> part is adding parameter *l in all API which uses bdrv_states, then move >> bdrv_states to caller. About 10 functions need to be converted, so hope to >> get comments before that, to see if this is the right direction. > The global bdrv_states list needs to stay, I don't think we should try > to remove it. > > The list is used to drain and flush all devices so that we can safely > shut down or live migrate. If we give each thread their own list then > there's no way to globally drain and flush. > > The invalidate function that you modified is another example: we *must* > invalidate all BDS instances across all threads. Failure to invalidate > all instances could mean inconsistencies or data loss. > > So in the end I think we need to keep bdrv_states. I am OK to keep bdrv_states now, after the talk about AioContext in IRC. I think it is related with thread model, and, If we find drain a subset of BDS is needed, such as per AioContext drain, it is no late to change at that time, after the programming model is built. Looking forward to your next series for AioContext. > > Stefan >