{"id":805684,"url":"http://patchwork.ozlabs.org/api/1.2/patches/805684/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/efa83205-dd02-105f-a0a6-8d6ff4231612@linux.vnet.ibm.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.2/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<efa83205-dd02-105f-a0a6-8d6ff4231612@linux.vnet.ibm.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/efa83205-dd02-105f-a0a6-8d6ff4231612@linux.vnet.ibm.com/","date":"2017-08-24T22:07:56","name":"[V10,2/2] powerpc/nodes: Ensure enough nodes avail for operations","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"417f5eddac5123f631846dcec0e5d7c9d363c2ef","submitter":{"id":65104,"url":"http://patchwork.ozlabs.org/api/1.2/people/65104/?format=json","name":"Michael Bringmann","email":"mwb@linux.vnet.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/efa83205-dd02-105f-a0a6-8d6ff4231612@linux.vnet.ibm.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/805684/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/805684/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xddnz730Jz9t3P\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 25 Aug 2017 08:12:39 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xddnz6GP7zDrKv\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 25 Aug 2017 08:12:39 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xddhv6t4zzDrKj\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 25 Aug 2017 08:08:15 +1000 (AEST)","from pps.filterd (m0098416.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7OM4Fca010749\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 24 Aug 2017 18:08:13 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2chyq0khmq-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 24 Aug 2017 18:08:12 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <mwb@linux.vnet.ibm.com>;\n\tThu, 24 Aug 2017 16:08:12 -0600","from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 24 Aug 2017 16:07:58 -0600","from b03ledav001.gho.boulder.ibm.com\n\t(b03ledav001.gho.boulder.ibm.com [9.17.130.232])\n\tby b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7OM7wth64946222; Thu, 24 Aug 2017 15:07:58 -0700","from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 6418C6E038;\n\tThu, 24 Aug 2017 16:07:58 -0600 (MDT)","from oc1554177480.ibm.com (unknown [9.80.214.231])\n\tby b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 36EFA6E03D;\n\tThu, 24 Aug 2017 16:07:57 -0600 (MDT)"],"To":"linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org","From":"Michael Bringmann <mwb@linux.vnet.ibm.com>","Subject":"[PATCH V10 2/2] powerpc/nodes: Ensure enough nodes avail for\n\toperations","Organization":"IBM Linux Technology Center","In-Reply-To":"<db1b23c1-67bc-fb0f-51f9-af4bc564d9ef@linux.vnet.ibm.com>","Date":"Thu, 24 Aug 2017 17:07:56 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","x-cbid":"17082422-8235-0000-0000-00000C2B7A1E","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007605; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000225; SDB=6.00907146; UDB=6.00454739;\n\tIPR=6.00687343; \n\tBA=6.00005552; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016853;\n\tXFM=3.00000015; UTC=2017-08-24 22:08:11","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17082422-8236-0000-0000-00003D5EEA46","Message-Id":"<efa83205-dd02-105f-a0a6-8d6ff4231612@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-24_08:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708240340","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"Michael Bringmann <mwb@linux.vnet.ibm.com>,\n\tNathan Fontenot <nfont@linux.vnet.ibm.com>,\n\tJohn Allen <jallen@linux.vnet.ibm.com>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"From: Michael Bringmann <mwb@linux.vnet.ibm.com>\nTo: linuxppc-dev@lists.ozlabs.org\nTo: linux-kernel@vger.kernel.org\nCc: Michael Ellerman <mpe@ellerman.id.au>\nCc: Michael Bringmann <mwb@linux.vnet.ibm.com>\nCc: John Allen <jallen@linux.vnet.ibm.com>\nCc: Nathan Fontenot <nfont@linux.vnet.ibm.com>\nSubject: [PATCH V10 2/2] powerpc/nodes: Ensure enough nodes avail for operations\n\npowerpc/nodes: On systems like PowerPC which allow 'hot-add' of CPU\nor memory resources, it may occur that the new resources are to be\ninserted into nodes that were not used for these resources at bootup.\nIn the kernel, any node that is used must be defined and initialized\nat boot.\n\nThis patch extracts the value of the 'min_common_depth' element from\nthe \"rtas\" device tree property \"ibm,max-associativity-domains\" to use\nas the maximum number of nodes to setup as possibly available in the\nsystem.  [The 'min_common_depth' element is calculated from memory\nassociations found while loading all of the configured memory into\nthe system data structures at boot.]  This new setting will override\nthe instruction,\n\n    nodes_and(node_possible_map, node_possible_map, node_online_map);\n\npresently seen in the function arch/powerpc/mm/numa.c:initmem_init().\n\nIf the property is not present at boot, no operation will be performed\nto define or enable additional nodes.\n\nSigned-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>\n---\nChanges in V10:\n  -- Try to use 'min_common_depth' from NUMA initialization to select\n     domain level to use for maximum nodes.\n---\n arch/powerpc/mm/numa.c |   44 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 44 insertions(+)","diff":"diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c\nindex 73427e290..841d3b6 100644\n--- a/arch/powerpc/mm/numa.c\n+++ b/arch/powerpc/mm/numa.c\n@@ -896,6 +896,48 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)\n \tNODE_DATA(nid)->node_spanned_pages = spanned_pages;\n }\n \n+static void __init node_associativity_setup(void)\n+{\n+\tstruct device_node *rtas;\n+\n+\trtas = of_find_node_by_path(\"/rtas\");\n+\tif (rtas) {\n+\t\tconst __be32 *prop;\n+\t\tu32 len, entries, numnodes, i;\n+\n+\t\tprop = of_get_property(rtas, \"ibm,max-associativity-domains\", &len);\n+\t\tif (!prop || len < sizeof(unsigned int))\n+\t\t\tgoto endit;\n+\n+\t\tentries = of_read_number(prop++, 1);\n+\n+\t\tif (len < (entries * sizeof(unsigned int)))\n+\t\t\tgoto endit;\n+\n+\t\tdbg(\"numa: Debug: Entries = %d MCD = %d\\n\", entries, min_common_depth);\n+\n+\t\tif ((0 <= min_common_depth) && (min_common_depth <= (entries-1)))\n+\t\t\tentries = min_common_depth;\n+\t\telse\n+\t\t\tentries -= 1;\n+\n+\t\tnumnodes = of_read_number(&prop[entries], 1);\n+\n+\t\tprintk(KERN_INFO \"numa: Nodes = %d\\n\", numnodes);\n+\n+\t\tfor (i = 0; i < numnodes; i++) {\n+\t\t\tif (!node_possible(i)) {\n+\t\t\t\tsetup_node_data(i, 0, 0);\n+\t\t\t\tnode_set(i, node_possible_map);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+endit:\n+\tif (rtas)\n+\t\tof_node_put(rtas);\n+}\n+\n void __init initmem_init(void)\n {\n \tint nid, cpu;\n@@ -915,6 +957,8 @@ void __init initmem_init(void)\n \t */\n \tnodes_and(node_possible_map, node_possible_map, node_online_map);\n \n+\tnode_associativity_setup();\n+\n \tfor_each_online_node(nid) {\n \t\tunsigned long start_pfn, end_pfn;\n \n","prefixes":["V10","2/2"]}