WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1/6] xen-gntdev: Fix circular locking dependency

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/6] xen-gntdev: Fix circular locking dependency
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 2010 15:09:23 +0000
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Stefano
Delivery-date: Thu, 16 Dec 2010 07:10:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D095D2F.8070002@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1292338553-20575-1-git-send-email-dgdegra@xxxxxxxxxxxxx> <1292338553-20575-2-git-send-email-dgdegra@xxxxxxxxxxxxx> <4D07DD76.2010900@xxxxxxxx> <4D07E444.3020309@xxxxxxxxxxxxx> <1292406442.32368.2613.camel@xxxxxxxxxxxxxxxxxxxxxx> <4D095D2F.8070002@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Thu, 16 Dec 2010, Jeremy Fitzhardinge wrote:
> On 12/15/2010 01:47 AM, Ian Campbell wrote:
> > On Tue, 2010-12-14 at 21:40 +0000, Daniel De Graaf wrote:
> >> On 12/14/2010 04:11 PM, Jeremy Fitzhardinge wrote:
> >>> On 12/14/2010 06:55 AM, Daniel De Graaf wrote:
> >>>> apply_to_page_range will acquire PTE lock while priv->lock is held, and
> >>>> mn_invl_range_start tries to acquire priv->lock with PTE already held.
> >>>> Fix by not holding priv->lock during the entire map operation.
> >>> Is priv->lock needed to protect the contents of map?
> >>>
> >>>     J
> >> No, since the map can only be mapped once (checked by map->vma assignment
> >> while the lock is held). The unmap ioctl will return -EBUSY until
> >> an munmap() is called on the area, so it also can't race, and the other
> >> users are only active once the mmap operation completes.
> > Sounds reasonable enough to me. There are a few unlocked accesses to
> > vma->map: 
> >         gntdev_del_map (when called from gntdev_ioctl_map_grant_ref)
> >         gntdev_vma_close
> > are these safe? If so then it would be worth a comment about why.
> >
> > Anyway this patch appears to resolve the lockdep warning I was seeing
> > with 2.6.37 with qemu-xen backed block devices.
> 
> Good.  Stefano should stick this on his patch queue.
 
Agreed. I'll add it in the next version.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>