From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Egger, Christoph" Subject: Re: [PATCH v3 1/2] gnttab: Introduce rwlock to protect updates to grant table state Date: Fri, 9 Jan 2015 15:54:17 +0100 Message-ID: <54AFEB99.8090800@amazon.de> References: <1417616967-18720-1-git-send-email-chegger@amazon.de> <1417616967-18720-2-git-send-email-chegger@amazon.de> <5492CA7502000078000508E8@mail.emea.novell.com> <54AFD209.70209@amazon.de> <54AFEF5E02000078000532C7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54AFEF5E02000078000532C7@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: Julien Grall , Keir Fraser , Matt Wilson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 2015/01/09 15:10, Jan Beulich wrote: >>>> On 09.01.15 at 14:05, wrote: >> On 2014/12/18 12:37, Jan Beulich wrote: >>>>>> On 03.12.14 at 15:29, wrote: >>>> --- a/xen/common/grant_table.c >>>> +++ b/xen/common/grant_table.c >> [...] >>>> @@ -944,6 +944,7 @@ __gnttab_unmap_common( >>>> } >>>> >>>> op->rd = rd; >>>> + read_lock(&rgt->lock); >>>> act = &active_entry(rgt, op->map->ref); >>>> >>>> if ( op->frame == 0 ) >>> >>> The nesting of the two locks should be mentioned in the doc change. >> >> Where do you see the nesting coming from? > > Reproducing the subsequent hunk I had commented on > >> @@ -1004,6 +1005,7 @@ __gnttab_unmap_common( >> >> unmap_out: >> double_gt_unlock(lgt, rgt); >> + read_unlock(&rgt->lock); > > there obviously are two (or really three) locks in simultaneous use > here. Ah, I see now. My mistake is I was looking for multiple subsequent read_lock(&rgt->lock); calls and found nothing. Christoph