From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm: get rid of srcu idx Date: Tue, 26 Oct 2010 10:06:41 +0200 Message-ID: <4CC68C11.3010801@redhat.com> References: <20101024171610.GA24375@redhat.com> <20101025135229.GA3392@amt.cnet> <20101025132058.GA18082@redhat.com> <20101025201356.GA18436@amt.cnet> <20101026065820.GJ2343@redhat.com> <4CC689D4.9010401@redhat.com> <20101026080122.GL2343@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , "Michael S. Tsirkin" , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398Ab0JZIGp (ORCPT ); Tue, 26 Oct 2010 04:06:45 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9Q86j8G020313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 04:06:45 -0400 In-Reply-To: <20101026080122.GL2343@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/26/2010 10:01 AM, Gleb Natapov wrote: > On Tue, Oct 26, 2010 at 09:57:08AM +0200, Avi Kivity wrote: > > On 10/26/2010 08:58 AM, Gleb Natapov wrote: > > >> > > >> Well, you just changed where srcu index is saved. I don't see how it > > >> could make a difference in practice. > > >> > > >If there is nested call to srcu read lock if srcu_idx is stored in vcpu > > >nested call will override previous srcu_idx value and srcu unlock will > > >not be called on it, but it will be called twice on new srcu_idx value. > > >If srcu_idx is saved on stack this will not happen, no? > > > > Exactly. The case where srcu_idx is passed as a pointer parameter > > is still dubious, but we can change that too. > > > But shouldn't we disallow recursive srcu lock tacking? With different srcu_idx, nested (or overlapping) srcu is legal. -- error compiling committee.c: too many arguments to function