From patchwork Thu Aug 11 16:04:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 658286 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 3s9CY86qspz9s9x for ; Fri, 12 Aug 2016 02:05:48 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s9CY85tpDzDr3G for ; Fri, 12 Aug 2016 02:05:48 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s9CWx0RD7zDq5f for ; Fri, 12 Aug 2016 02:04:45 +1000 (AEST) Received: by ozlabs.org (Postfix) id 3s9CWx01Zgz9sXx; Fri, 12 Aug 2016 02:04:45 +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 3s9CWw4Kgcz9s9x for ; Fri, 12 Aug 2016 02:04:43 +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 u7BG3fvT112645 for ; Thu, 11 Aug 2016 12:04:41 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 24qm9v1kb9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 11 Aug 2016 12:04:41 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Aug 2016 10:04:40 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Aug 2016 10:04:37 -0600 X-IBM-Helo: d03dlp01.boulder.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 d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 43A3E1FF002E; Thu, 11 Aug 2016 10:04:19 -0600 (MDT) Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7BG4dwi62193752; Thu, 11 Aug 2016 16:04:39 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3815CAC055; Thu, 11 Aug 2016 12:04:36 -0400 (EDT) Received: from arbab-laptop.localdomain (unknown [9.53.92.230]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 2672AAC046; Thu, 11 Aug 2016 12:04:36 -0400 (EDT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id 0843E46054C; Thu, 11 Aug 2016 11:04:34 -0500 (CDT) From: Reza Arbab To: Mel Gorman , Andrew Morton , Paul Mackerras , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org Subject: [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats Date: Thu, 11 Aug 2016 11:04:33 -0500 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20160811092808.GD8119@techsingularity.net> References: <20160811092808.GD8119@techsingularity.net> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081116-0024-0000-0000-0000144EF4FC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005577; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000181; SDB=6.00743238; UDB=6.00349955; IPR=6.00515791; BA=6.00004658; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012313; XFM=3.00000011; UTC=2016-08-11 16:04:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081116-0025-0000-0000-00004378CCB6 Message-Id: <1470931473-7090-1-git-send-email-arbab@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-11_11:, , 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-1608110205 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: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The following oops occurs after a pgdat is hotadded: [ 86.839956] Unable to handle kernel paging request for data at address 0x00c30001 [ 86.840132] Faulting instruction address: 0xc00000000022f8f4 [ 86.840328] Oops: Kernel access of bad area, sig: 11 [#1] [ 86.840468] SMP NR_CPUS=2048 NUMA pSeries [ 86.840612] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter nls_utf8 isofs sg virtio_balloon uio_pdrv_genirq uio ip_tables xfs libcrc32c sr_mod cdrom sd_mod virtio_net ibmvscsi scsi_transport_srp virtio_pci virtio_ring virtio dm_mirror dm_region_hash dm_log dm_mod [ 86.842955] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.8.0-rc1-device #110 [ 86.843140] task: c000000000ef3080 task.stack: c000000000f6c000 [ 86.843323] NIP: c00000000022f8f4 LR: c00000000022f948 CTR: 0000000000000000 [ 86.843595] REGS: c000000000f6fa50 TRAP: 0300 Tainted: G W (4.8.0-rc1-device) [ 86.843889] MSR: 800000010280b033 CR: 84002028 XER: 20000000 [ 86.844624] CFAR: d000000001d2013c DAR: 0000000000c30001 DSISR: 40000000 SOFTE: 0 GPR00: c00000000022f948 c000000000f6fcd0 c000000000f71400 0000000000000001 GPR04: 0000000000000100 0000000000000000 0000000000000000 0000000000c30000 GPR08: ffffffffffffffff 0000000000000001 0000000000c30000 00000000ffffffff GPR12: 0000000000002200 c000000001300000 c000000000faefb4 c000000000faefa8 GPR16: c000000000f6c000 c000000000f6c080 c000000000bf15b0 c000000000f6c080 GPR20: c000000000bf4928 0000000000000000 0000000000000003 c000000000bf4968 GPR24: c0000000ffed0000 0000000000000000 0000000000000000 c000000000f6fd58 GPR28: 0000000000000001 0000000000000001 c000000000f6fcf0 c0000000ffed9c08 [ 86.847747] NIP [c00000000022f8f4] refresh_cpu_vm_stats+0x1a4/0x2f0 [ 86.847897] LR [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0 [ 86.848060] Call Trace: [ 86.848183] [c000000000f6fcd0] [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0 (unreliable) Add per_cpu_nodestats initialization to the hotplug codepath. Signed-off-by: Reza Arbab --- mm/memory_hotplug.c | 2 ++ 1 file changed, 2 insertions(+) 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; }