From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbdA3DkP (ORCPT ); Sun, 29 Jan 2017 22:40:15 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35056 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbdA3Dj5 (ORCPT ); Sun, 29 Jan 2017 22:39:57 -0500 From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: mhocko@suse.com, vbabka@suse.cz, mgorman@suse.de, minchan@kernel.org, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, srikar@linux.vnet.ibm.com, haren@linux.vnet.ibm.com, jglisse@redhat.com, dave.hansen@intel.com, dan.j.williams@intel.com Subject: [DEBUG 14/21] powerpc/mm: Create numa nodes for hotplug memory Date: Mon, 30 Jan 2017 09:05:55 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130033602.12275-1-khandual@linux.vnet.ibm.com> References: <20170130033602.12275-1-khandual@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17013003-0004-0000-0000-000001DB0380 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17013003-0005-0000-0000-00000993DDFC Message-Id: <20170130033602.12275-15-khandual@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-30_02:,, 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-1612050000 definitions=main-1701300038 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 --- .../bindings/powerpc/opal/hotplug-aperture.txt | 26 ++++++++++++++++++++++ arch/powerpc/mm/numa.c | 10 +++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/powerpc/opal/hotplug-aperture.txt diff --git a/Documentation/devicetree/bindings/powerpc/opal/hotplug-aperture.txt b/Documentation/devicetree/bindings/powerpc/opal/hotplug-aperture.txt new file mode 100644 index 0000000..b8dffaa --- /dev/null +++ b/Documentation/devicetree/bindings/powerpc/opal/hotplug-aperture.txt @@ -0,0 +1,26 @@ +Designated hotplug memory +------------------------- + +This binding describes a region of hotplug memory which is not present at boot, +allowing its eventual NUMA associativity to be prespecified. + +Required properties: + +- compatible + "ibm,hotplug-aperture" + +- reg + base address and size of the region (standard definition) + +- ibm,associativity + NUMA associativity (standard definition) + +Example: + +A 2 GiB aperture at 0x100000000, to be part of nid 3 when hotplugged: + + hotplug-memory@100000000 { + compatible = "ibm,hotplug-aperture"; + reg = <0x0 0x100000000 0x0 0x80000000>; + ibm,associativity = <0x4 0x0 0x0 0x0 0x3>; + }; diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 6def078..5370833 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -717,6 +717,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; @@ -761,7 +767,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; @@ -1056,7 +1062,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.9.3