From patchwork Tue Mar 25 06:50:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: maddy X-Patchwork-Id: 333291 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 2D39F14013E for ; Tue, 25 Mar 2014 17:51:42 +1100 (EST) Received: from e28smtp09.in.ibm.com (e28smtp09.in.ibm.com [122.248.162.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3EC0A14008F for ; Tue, 25 Mar 2014 17:50:31 +1100 (EST) Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Mar 2014 12:20:25 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Mar 2014 12:20:25 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id C6699E0057 for ; Tue, 25 Mar 2014 12:24:22 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2P6oAZc60031022 for ; Tue, 25 Mar 2014 12:20:10 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2P6oLlD016498 for ; Tue, 25 Mar 2014 12:20:22 +0530 Received: from SrihariMadhavan.in.ibm.com (sriharimadhavan.in.ibm.com [9.121.0.72] (may be forged)) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s2P6oKKI016349; Tue, 25 Mar 2014 12:20:21 +0530 From: Madhavan Srinivasan To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org Subject: [PATCH 1/1] mm: move FAULT_AROUND_ORDER to arch/ Date: Tue, 25 Mar 2014 12:20:15 +0530 Message-Id: <1395730215-11604-2-git-send-email-maddy@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395730215-11604-1-git-send-email-maddy@linux.vnet.ibm.com> References: <1395730215-11604-1-git-send-email-maddy@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14032506-2674-0000-0000-00000D521071 Cc: riel@redhat.com, ak@linux.intel.com, peterz@infradead.org, rusty@rustcorp.com.au, Madhavan Srinivasan , paulus@samba.org, mgorman@suse.de, akpm@linux-foundation.org, mingo@kernel.org, kirill.shutemov@linux.intel.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Kirill A. Shutemov with the commit 96bacfe542 introduced vm_ops->map_pages() for mapping easy accessible pages around fault address in hope to reduce number of minor page faults. Based on his workload runs, suggested FAULT_AROUND_ORDER (knob to control the numbers of pages to map) is 4. This patch moves the FAULT_AROUND_ORDER macro to arch/ for architecture maintainers to decide on suitable FAULT_AROUND_ORDER value based on performance data for that architecture. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/pgtable.h | 6 ++++++ arch/x86/include/asm/pgtable.h | 5 +++++ include/asm-generic/pgtable.h | 10 ++++++++++ mm/memory.c | 2 -- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index 3ebb188..9fcbd48 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -19,6 +19,12 @@ struct mm_struct; #endif /* + * With a few real world workloads that were run, + * the performance data showed that a value of 3 is more advantageous. + */ +#define FAULT_AROUND_ORDER 3 + +/* * We save the slot number & secondary bit in the second half of the * PTE page. We use the 8 bytes per each pte entry. */ diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 938ef1d..8387a65 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -7,6 +7,11 @@ #include /* + * Based on Kirill's test results, fault around order is set to 4 + */ +#define FAULT_AROUND_ORDER 4 + +/* * Macro to mark a page protection value as UC- */ #define pgprot_noncached(prot) \ diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1ec08c1..62f7f07 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -7,6 +7,16 @@ #include #include + +/* + * Fault around order is a control knob to decide the fault around pages. + * Default value is set to 0UL (disabled), but the arch can override it as + * desired. + */ +#ifndef FAULT_AROUND_ORDER +#define FAULT_AROUND_ORDER 0UL +#endif + /* * On almost all architectures and configurations, 0 can be used as the * upper ceiling to free_pgtables(): on many architectures it has the same diff --git a/mm/memory.c b/mm/memory.c index b02c584..fd79ffc 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3358,8 +3358,6 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address, update_mmu_cache(vma, address, pte); } -#define FAULT_AROUND_ORDER 4 - #ifdef CONFIG_DEBUG_FS static unsigned int fault_around_order = FAULT_AROUND_ORDER;