From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx141.postini.com [74.125.245.141]) by kanga.kvack.org (Postfix) with SMTP id 324296B00EC for ; Fri, 25 May 2012 13:03:13 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 07/35] autonuma: teach gup_fast about pte_numa Date: Fri, 25 May 2012 19:02:11 +0200 Message-Id: <1337965359-29725-8-git-send-email-aarcange@redhat.com> In-Reply-To: <1337965359-29725-1-git-send-email-aarcange@redhat.com> References: <1337965359-29725-1-git-send-email-aarcange@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter gup_fast will skip over non present ptes (pte_numa requires the pte to be non present). So no explicit check is needed for pte_numa in the pte case. gup_fast will also automatically skip over THP when the trans huge pmd is non present (pmd_numa requires the pmd to be non present). But for the special pmd mode scan of knuma_scand (/sys/kernel/mm/autonuma/knuma_scand/pmd == 1), the pmd may be of numa type (so non present too), the pte may be present. gup_pte_range wouldn't notice the pmd is of numa type. So to avoid losing a NUMA hinting page fault with gup_fast we need an explicit check for pmd_numa() here to be sure it will fault through gup -> handle_mm_fault. Signed-off-by: Andrea Arcangeli --- arch/x86/mm/gup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index dd74e46..bf36575 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c @@ -164,7 +164,7 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end, * wait_split_huge_page() would never return as the * tlb flush IPI wouldn't run. */ - if (pmd_none(pmd) || pmd_trans_splitting(pmd)) + if (pmd_none(pmd) || pmd_trans_splitting(pmd) || pmd_numa(pmd)) return 0; if (unlikely(pmd_large(pmd))) { if (!gup_huge_pmd(pmd, addr, next, write, pages, nr)) -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org