From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with ESMTP id 410DF6B00B6 for ; Tue, 26 Jan 2010 14:50:36 -0500 (EST) Date: Tue, 26 Jan 2010 19:50:22 +0000 From: Mel Gorman Subject: Re: [PATCH 16 of 31] bail out gup_fast on splitting pmd Message-ID: <20100126195022.GT16468@csn.ul.ie> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli Cc: linux-mm@kvack.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Rik van Riel , Andi Kleen , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , Andrew Morton , bpicco@redhat.com, Christoph Hellwig , KOSAKI Motohiro List-ID: On Tue, Jan 26, 2010 at 02:52:11PM +0100, Andrea Arcangeli wrote: > From: Andrea Arcangeli > > Force gup_fast to take the slow path and block if the pmd is splitting, not > only if it's none. > > Signed-off-by: Andrea Arcangeli Acked-by: Mel Gorman > --- > > diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c > --- a/arch/x86/mm/gup.c > +++ b/arch/x86/mm/gup.c > @@ -156,7 +156,18 @@ static int gup_pmd_range(pud_t pud, unsi > pmd_t pmd = *pmdp; > > next = pmd_addr_end(addr, end); > - if (pmd_none(pmd)) > + /* > + * The pmd_trans_splitting() check below explains why > + * pmdp_splitting_flush has to flush the tlb, to stop > + * this gup-fast code from running while we set the > + * splitting bit in the pmd. Returning zero will take > + * the slow path that will call wait_split_huge_page() > + * if the pmd is still in splitting state. gup-fast > + * can't because it has irq disabled and > + * wait_split_huge_page() would never return as the > + * tlb flush IPI wouldn't run. > + */ > + if (pmd_none(pmd) || pmd_trans_splitting(pmd)) > return 0; > if (unlikely(pmd_large(pmd))) { > if (!gup_huge_pmd(pmd, addr, next, write, pages, nr)) > -- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org