From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv11 2/4] gnttab: introduce maptrack lock Date: Fri, 5 Jun 2015 15:41:23 +0100 Message-ID: <5571B513.3020102@citrix.com> References: <1433262381-8965-1-git-send-email-david.vrabel@citrix.com> <1433262381-8965-3-git-send-email-david.vrabel@citrix.com> <5571C1D6020000780008168A@mail.emea.novell.com> <5571A7B0.3090305@citrix.com> <5571D0A0020000780008171A@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0soL-0001Qn-0u for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 14:41:29 +0000 In-Reply-To: <5571D0A0020000780008171A@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 15:38, Jan Beulich wrote: >>>> On 05.06.15 at 15:44, wrote: >> On 05/06/15 14:35, Jan Beulich wrote: >>>>>> On 02.06.15 at 18:26, wrote: >>>> --- a/xen/common/grant_table.c >>>> +++ b/xen/common/grant_table.c >>>> @@ -288,10 +288,10 @@ static inline void put_maptrack_handle( >>>> struct grant_table *t, int handle) >>>> { >>>> - spin_lock(&t->lock); >>>> + spin_lock(&t->maptrack_lock); >>>> maptrack_entry(t, handle).ref = t->maptrack_head; >>>> t->maptrack_head = handle; >>>> - spin_unlock(&t->lock); >>>> + spin_unlock(&t->maptrack_lock); >>> >>> Starting with this change it becomes unclear what protects the >>> maptrack entries - the grant table lock or the maptrack one? >> >> The grant table lock. The docs aren't very good here -- the maptrack >> lock is only for the maptrack free list. > > I don't think the grant table lock serves that purpose, at least not > anymore after being converted to RW. See my reply on patch 3. Sorry for not being clear, after this patch #2 it is the grant table lock that serves this purpose. After #3 it's as you said there. David