From patchwork Wed Aug 10 17:59:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 657762 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s8f921xbqz9sRB for ; Thu, 11 Aug 2016 04:01:26 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s8f920dJPzDqd9 for ; Thu, 11 Aug 2016 04:01:25 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s8f7F1Lf9zDqJ5 for ; Thu, 11 Aug 2016 03:59:53 +1000 (AEST) Received: by ozlabs.org (Postfix) id 3s8f7D6369z9sxb; Thu, 11 Aug 2016 03:59:52 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s8f7D33bVz9sRB for ; Thu, 11 Aug 2016 03:59:52 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7AHrp0F138901 for ; Wed, 10 Aug 2016 13:59:50 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 24qm9tjagw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 10 Aug 2016 13:59:50 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Aug 2016 13:59:48 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Aug 2016 13:59:45 -0400 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id DB365C9004A; Wed, 10 Aug 2016 13:59:32 -0400 (EDT) Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7AHxlZr19399086; Wed, 10 Aug 2016 17:59:47 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1F3F12403D; Wed, 10 Aug 2016 13:59:43 -0400 (EDT) Received: from arbab-laptop.localdomain (unknown [9.53.92.230]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 8C130124014; Wed, 10 Aug 2016 13:59:43 -0400 (EDT) Received: from arbab-laptop.austin.ibm.com (localhost [IPv6:::1]) by arbab-laptop.localdomain (Postfix) with ESMTP id 47B30460491; Wed, 10 Aug 2016 12:59:40 -0500 (CDT) Date: Wed, 10 Aug 2016 12:59:40 -0500 From: Reza Arbab To: Mel Gorman Subject: Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot References: <20160804092404.GI2799@techsingularity.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160804092404.GI2799@techsingularity.net> Organization: IBM Linux Technology Center User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081017-0044-0000-0000-000000E1B32D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005573; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000180; SDB=6.00742796; UDB=6.00349691; IPR=6.00515353; BA=6.00004655; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012302; XFM=3.00000011; UTC=2016-08-10 17:59:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081017-0045-0000-0000-000004F7F769 Message-Id: <20160810175940.GA12039@arbab-laptop.austin.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-10_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608100184 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Aug 04, 2016 at 10:24:04AM +0100, Mel Gorman wrote: >[ 1.713998] Unable to handle kernel paging request for data at address 0xff7a10000 >[ 1.714164] Faulting instruction address: 0xc000000000270cd0 >[ 1.714304] Oops: Kernel access of bad area, sig: 11 [#1] >[ 1.714414] SMP NR_CPUS=2048 NUMA PowerNV >[ 1.714530] Modules linked in: >[ 1.714647] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0-kvm+ #118 >[ 1.714786] task: c000000ff0680010 task.stack: c000000ff0704000 >[ 1.714926] NIP: c000000000270cd0 LR: c000000000270ce8 CTR: 0000000000000000 >[ 1.715093] REGS: c000000ff0707900 TRAP: 0300 Not tainted (4.7.0-kvm+) >[ 1.715232] MSR: 9000000102009033 CR: 846b6824 XER: 20000000 >[ 1.715748] CFAR: c000000000008768 DAR: 0000000ff7a10000 DSISR: 42000000 SOFTE: 1 >GPR00: c000000000270d08 c000000ff0707b80 c0000000011fb200 0000000000000000 >GPR04: 0000000000000800 0000000000000000 0000000000000000 0000000000000000 >GPR08: ffffffffffffffff 0000000000000000 0000000ff7a10000 c00000000122aae0 >GPR12: c000000000a1e440 c00000000fb80000 c00000000000c188 0000000000000000 >GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 >GPR20: 0000000000000000 0000000000000000 0000000000000000 c000000000cecad0 >GPR24: c000000000d035b8 c000000000d6cd18 c000000000d6cd18 c000001fffa86300 >GPR28: 0000000000000000 c000001fffa96300 c000000001230034 c00000000122eb18 >[ 1.717484] NIP [c000000000270cd0] refresh_zone_stat_thresholds+0x80/0x240 >[ 1.717568] LR [c000000000270ce8] refresh_zone_stat_thresholds+0x98/0x240 >[ 1.717648] Call Trace: >[ 1.717687] [c000000ff0707b80] [c000000000270d08] refresh_zone_stat_thresholds+0xb8/0x240 (unreliable) I've been investigating node hotplug. That path is also going to require initialization of per_cpu_nodestats. This worked for me: diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 3894b65..41266dc 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1219,6 +1219,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) /* init node's zones as empty zones, we don't have any present pages.*/ free_area_init_node(nid, zones_size, start_pfn, zholes_size); + pgdat->per_cpu_nodestats = alloc_percpu(struct per_cpu_nodestat); /* * The node we allocated has no zone fallback lists. For avoiding @@ -1249,6 +1250,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) static void rollback_node_hotadd(int nid, pg_data_t *pgdat) { arch_refresh_nodedata(nid, NULL); + free_percpu(pgdat->per_cpu_nodestats); arch_free_nodedata(pgdat); return; }