From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv11 1/4] gnttab: per-active entry locking Date: Fri, 5 Jun 2015 14:41:59 +0100 Message-ID: <5571A727.3040503@citrix.com> References: <1433262381-8965-1-git-send-email-david.vrabel@citrix.com> <1433262381-8965-2-git-send-email-david.vrabel@citrix.com> <5571C115020000780008167F@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0rsr-0002c8-I7 for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 13:42:05 +0000 In-Reply-To: <5571C115020000780008167F@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, Malcolm Crossley , Keir Fraser , Ian Campbell , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 05/06/15 14:32, Jan Beulich wrote: >>>> On 02.06.15 at 18:26, wrote: >> @@ -546,13 +567,19 @@ static void mapcount( >> >> *wrc = *rdc = 0; >> >> + /* >> + * Must have the remote domain's grant table lock while counting >> + * its active entries. >> + */ >> + ASSERT(spin_is_locked(&rd->grant_table->lock)); >> + >> for ( handle = 0; handle < lgt->maptrack_limit; handle++ ) > > The comment and the use of lgt->maptrack_limit contradict the > documentation you add in patch 2, and it indeed is unclear why > at this point the local domain's lock (its maptrack lock starting > with patch 2) doesn't also need to be held. Maybe it's a a bit subtle, but holding the local (write) lock means no new mappings can be created and thus lgt->maptrack_limit cannot change. Should I add ASSERT(spin_is_locked(&lgt->lock)); here as well? David