From patchwork Thu Sep 18 23:22:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 391028 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7548414018B for ; Fri, 19 Sep 2014 09:23:20 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 421B61A0B51 for ; Fri, 19 Sep 2014 09:23:20 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 15944 seconds by postgrey-1.34 at bilbo; Fri, 19 Sep 2014 09:22:42 AEST Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0127.outbound.protection.outlook.com [65.55.169.127]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id EEF4F1A012D for ; Fri, 19 Sep 2014 09:22:42 +1000 (EST) Received: from home.buserror.net (2601:2:5800:3f7:9d2d:42ec:ad0e:7ffa) by BN1PR0301MB0723.namprd03.prod.outlook.com (25.160.78.142) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Thu, 18 Sep 2014 23:22:32 +0000 Date: Thu, 18 Sep 2014 18:22:26 -0500 From: Scott Wood To: Subject: [PATCH] powerpc/mm: Use common paging_init() for NUMA Message-ID: <20140918232226.GA20727@home.buserror.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [2601:2:5800:3f7:9d2d:42ec:ad0e:7ffa] X-ClientProxiedBy: BN1PR02CA0012.namprd02.prod.outlook.com (10.141.56.12) To BN1PR0301MB0723.namprd03.prod.outlook.com (25.160.78.142) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0723; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(107046002)(83072002)(229853001)(19580395003)(2351001)(33656002)(83322001)(19580405001)(101416001)(42186005)(69596002)(95666004)(20776003)(47776003)(54356999)(50986999)(21056001)(102836001)(76482002)(92566001)(87976001)(92726001)(53416004)(99396002)(83506001)(64706001)(85306004)(85852003)(110136001)(23726002)(97736003)(81156004)(4396001)(81342003)(79102003)(74502003)(80022003)(86362001)(46102003)(74662003)(97756001)(81542003)(77982003)(77096002)(105586002)(46406003)(50466002)(90102001)(31966008)(106356001)(3826002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR0301MB0723; H:home.buserror.net; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-OriginatorOrg: freescale.com Cc: Stephen Rothwell X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 1c98025c6c95bc057a25e2c6596de23288c68160 "powerpc: Dynamic DMA zone limits" updated how zones are created in paging_init(), but missed the NUMA version of paging_init(). This was noticed via a linker error, since dma_pfn_limit_to_zone() was, like the non-NUMA paging_init(), limited by #ifndef CONFIG_NEED_MULTIPLE_NODES. It turns out that the NUMA paging_init() was not actually doing anything different from the standard paging_init(), other than a couple debug prints, a couple 32-bit-only ifdef sections, and a call to mark_nonram_nosave(). It's not clear whether mark_nonram_nosave() is inherently wrong to do for NUMA, or just not useful on targets that have NUMA, but for now I'm preserving the existing behavior. Reported-by: Stephen Rothwell Signed-off-by: Scott Wood --- I've tested this with CONFIG_NUMA turned on on a NUMA-less system. While this patch shouldn't cause any functional difference to what happens in paging_init(), it would be helpful if someone with access to a NUMA system could test. And yes, I did try building ppc64_defconfig with "powerpc: Dynamic DMA zone limits" before pushing, but the linker doesn't put "error:" in its errors, so my build script (since updated) missed it. arch/powerpc/mm/mem.c | 7 ++++++- arch/powerpc/mm/numa.c | 8 -------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 687e7f7..420dfff 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -259,6 +259,12 @@ static int __init mark_nonram_nosave(void) } return 0; } +#else /* CONFIG_NEED_MULTIPLE_NODES */ +static int __init mark_nonram_nosave(void) +{ + return 0; +} +#endif static bool zone_limits_final; @@ -351,7 +357,6 @@ void __init paging_init(void) mark_nonram_nosave(); } -#endif /* ! CONFIG_NEED_MULTIPLE_NODES */ static void __init register_page_bootmem_info(void) { diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 3b181b2..5eb07f3 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1126,14 +1126,6 @@ void __init do_init_bootmem(void) (void *)(unsigned long)boot_cpuid); } -void __init paging_init(void) -{ - unsigned long max_zone_pfns[MAX_NR_ZONES]; - memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); - max_zone_pfns[ZONE_DMA] = memblock_end_of_DRAM() >> PAGE_SHIFT; - free_area_init_nodes(max_zone_pfns); -} - static int __init early_numa(char *p) { if (!p)