From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH] kvm: get rid of srcu idx Date: Tue, 26 Oct 2010 10:53:39 +0200 Message-ID: <20101026085339.GB23530@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> <4CC68C11.3010801@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:64179 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092Ab0JZJAS (ORCPT ); Tue, 26 Oct 2010 05:00:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9Q90Hbd031092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 05:00:18 -0400 Content-Disposition: inline In-Reply-To: <4CC68C11.3010801@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Oct 26, 2010 at 10:06:41AM +0200, Avi Kivity wrote: > 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. Right. If vcpu_enter_guest gets calles under a nested srcu call we'll still get a deadlock, however. > -- > error compiling committee.c: too many arguments to function