From patchwork Mon Aug 8 18:27:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 656929 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 3s7Qsy2p6nz9sBM for ; Tue, 9 Aug 2016 04:29:10 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s7Qsy22QvzDqd9 for ; Tue, 9 Aug 2016 04:29:10 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.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 lists.ozlabs.org (Postfix) with ESMTPS id 3s7Qr65ZvrzDqd9 for ; Tue, 9 Aug 2016 04:27:34 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u78IR0Un113438 for ; Mon, 8 Aug 2016 14:27:32 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 24nce8b5m1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 14:27:32 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 12:27:31 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 Aug 2016 12:27:28 -0600 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 294CB19D8047; Mon, 8 Aug 2016 12:27:01 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u78IRRsd25034970; Mon, 8 Aug 2016 11:27:27 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4DDB66E038; Mon, 8 Aug 2016 12:27:27 -0600 (MDT) Received: from arbab-laptop.localdomain (unknown [9.53.92.230]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 4101C7A003; Mon, 8 Aug 2016 12:27:27 -0600 (MDT) Received: by arbab-laptop.localdomain (Postfix, from userid 152845) id 531244606AD; Mon, 8 Aug 2016 13:27:23 -0500 (CDT) From: Reza Arbab To: Rob Herring , Mark Rutland , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jonathan Corbet , Bharata B Rao , Nathan Fontenot , devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] powerpc/mm: create numa nodes for hotplug memory Date: Mon, 8 Aug 2016 13:27:21 -0500 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1470680843-28702-1-git-send-email-arbab@linux.vnet.ibm.com> References: <1470680843-28702-1-git-send-email-arbab@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080818-0020-0000-0000-00000982021D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005567; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000178; SDB=6.00741845; UDB=6.00349120; IPR=6.00514403; BA=6.00004651; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012249; XFM=3.00000011; UTC=2016-08-08 18:27:30 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080818-0021-0000-0000-00005463502D Message-Id: <1470680843-28702-3-git-send-email-arbab@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-08_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608080184 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" When scanning the device tree to initialize the system NUMA topology, process dt elements with compatible id "ibm,hotplug-aperture" to create memoryless numa nodes. These nodes will be filled when hotplug occurs within the associated address range. Signed-off-by: Reza Arbab Acked-by: Balbir Singh --- arch/powerpc/mm/numa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 75b9cd6..80d067d 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -708,6 +708,12 @@ static void __init parse_drconf_memory(struct device_node *memory) } } +static const struct of_device_id memory_match[] = { + { .type = "memory" }, + { .compatible = "ibm,hotplug-aperture" }, + { /* sentinel */ } +}; + static int __init parse_numa_properties(void) { struct device_node *memory; @@ -752,7 +758,7 @@ static int __init parse_numa_properties(void) get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells); - for_each_node_by_type(memory, "memory") { + for_each_matching_node(memory, memory_match) { unsigned long start; unsigned long size; int nid; @@ -1080,7 +1086,7 @@ static int hot_add_node_scn_to_nid(unsigned long scn_addr) struct device_node *memory; int nid = -1; - for_each_node_by_type(memory, "memory") { + for_each_matching_node(memory, memory_match) { unsigned long start, size; int ranges; const __be32 *memcell_buf;