Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758005Ab2EYRKY (ORCPT ); Fri, 25 May 2012 13:10:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26799 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165Ab2EYRDa (ORCPT ); Fri, 25 May 2012 13:03:30 -0400 From: Andrea Arcangeli 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 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1600 Lines: 38 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/