|   xen-devel
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock 
| To: | "Andrea Arcangeli" <aarcange@xxxxxxxxxx>,	"Johannes Weiner" <jweiner@xxxxxxxxxx> |  
| Subject: | [Xen-devel] Re: [PATCH] fix pgd_lock deadlock |  
| From: | "Jan Beulich" <JBeulich@xxxxxxxxxx> |  
| Date: | Tue, 22 Feb 2011 07:48:54 +0000 |  
| Cc: | Jeremy Fitzhardinge <jeremy@xxxxxxxx>,	"Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>,	Ian Campbell <Ian.Campbell@xxxxxxxxxx>,	Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>,	Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>,	the arch/x86 maintainers <x86@xxxxxxxxxx>, Hugh Dickins <hughd@xxxxxxxxxx>,	Larry Woodman <lwoodman@xxxxxxxxxx>, Andi Kleen <andi@xxxxxxxxxxxxxx>,	"H. Peter Anvin" <hpa@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>,	Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> |  
| Delivery-date: | Mon, 21 Feb 2011 23:49:52 -0800 |  
| Envelope-to: | www-data@xxxxxxxxxxxxxxxxxxx |  
| In-reply-to: | <20110221145350.GH25382@xxxxxxxxxx> |  
| 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: | <20110204012109.GP5843@xxxxxxxxxxxxx>	<4D4C6F45.6010204@xxxxxxxx> <20110207232045.GJ3347@xxxxxxxxxxxxx>	<20110215190710.GL5935@xxxxxxxxxxxxx>	<alpine.LFD.2.00.1102152020590.26192@xxxxxxxxxxxxxxxxxxxxxxx>	<20110215195450.GO5935@xxxxxxxxxxxxx>	<alpine.LFD.2.00.1102152102530.26192@xxxxxxxxxxxxxxxxxxxxxxx>	<20110216183304.GD5935@xxxxxxxxxxxxx>	<20110217101941.GH2380@xxxxxxxxxx>	<20110221143023.GF13092@xxxxxxxxxxxxx>	<20110221145350.GH25382@xxxxxxxxxx> |  
| Sender: | xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |  
| >>> On 21.02.11 at 15:53, Johannes Weiner <jweiner@xxxxxxxxxx> wrote:
> On Mon, Feb 21, 2011 at 03:30:23PM +0100, Andrea Arcangeli wrote:
>> On Thu, Feb 17, 2011 at 11:19:41AM +0100, Johannes Weiner wrote:
>> > So Xen needs all page tables protected when pinning/unpinning and
>> > extended page_table_lock to cover kernel range, which it does nowhere
>> > else AFAICS.  But the places it extended are also taking the pgd_lock,
>> > so I wonder if Xen could just take the pgd_lock itself in these paths
>> > and we could revert page_table_lock back to cover user va only?
>> > Jeremy, could this work?  Untested.
>> 
>> If this works for Xen, I definitely prefer this.
> 
> Below is real submission, with changelog and sign-off and all (except
> testing on Xen itself, sorry).  I moved pgd_lock acquisition in this
> version to make the lock ordering perfectly clear.  Xen people, could
> you have a look at this?
While I think that it would be correct, it doesn't look like a
reasonable fix to me: It effectively serializes process (address
space) construction and destruction.
A possible alternative would be to acquire the page table lock
in vmalloc_sync_all() only in the Xen case (perhaps by storing
NULL into page->index in pgd_set_mm() when not running on
Xen). This is utilizing the fact that there aren't (supposed to
be - for non-pvops this is definitely the case) any TLB flush IPIs
under Xen, and hence the race you're trying to fix doesn't
exist there (while non-Xen doesn't need the extra locking).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 | 
 
| <Prev in Thread] | Current Thread | [Next in Thread> |  | 
[Xen-devel] Re: [PATCH] x86: hold mm->page_table_lock while doing	vmalloc_sync, Larry Woodman[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, (continued)
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Konrad Rzeszutek Wilk
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Johannes Weiner
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Johannes Weiner
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock,
Jan Beulich <=
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Jan Beulich
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Jeremy Fitzhardinge
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Jan Beulich
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Andrea Arcangeli
[Xen-devel] Re: [PATCH] fix pgd_lock deadlock, Jeremy Fitzhardinge
 |  |  |