From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757056AbcJXEmu (ORCPT ); Mon, 24 Oct 2016 00:42:50 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55574 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752901AbcJXEmp (ORCPT ); Mon, 24 Oct 2016 00:42:45 -0400 From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: mhocko@suse.com, js1304@gmail.com, vbabka@suse.cz, mgorman@suse.de, minchan@kernel.org, akpm@linux-foundation.org, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com Subject: [DEBUG 02/10] powerpc/mm: Create numa nodes for hotplug memory Date: Mon, 24 Oct 2016 10:12:21 +0530 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1477284149-2976-1-git-send-email-khandual@linux.vnet.ibm.com> References: <1477283517-2504-1-git-send-email-khandual@linux.vnet.ibm.com> <1477284149-2976-1-git-send-email-khandual@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102404-1617-0000-0000-0000016E92B8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102404-1618-0000-0000-000046FAB67A Message-Id: <1477284149-2976-3-git-send-email-khandual@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-23_18:,, 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-1609300000 definitions=main-1610240083 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Reza Arbab 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 Signed-off-by: Anshuman Khandual --- 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 a51c188..42fcc8e 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; @@ -1044,7 +1050,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; -- 2.1.0