{"id":815075,"url":"http://patchwork.ozlabs.org/api/1.2/patches/815075/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/d62dd6c7-7676-5fe0-4f63-baada9213908@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":"<d62dd6c7-7676-5fe0-4f63-baada9213908@linux.vnet.ibm.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/d62dd6c7-7676-5fe0-4f63-baada9213908@linux.vnet.ibm.com/","date":"2017-09-18T18:28:33","name":"[1/2] powerpc/nodes: Ensure enough nodes avail for operations","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"e3187e2ce6cc7de97fd314eed5917682847b705b","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/d62dd6c7-7676-5fe0-4f63-baada9213908@linux.vnet.ibm.com/mbox/","series":[{"id":3702,"url":"http://patchwork.ozlabs.org/api/1.2/series/3702/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=3702","date":"2017-09-18T18:28:11","name":"powerpc/nodes/hotplug: Fix problem with memoryless nodes","version":1,"mbox":"http://patchwork.ozlabs.org/series/3702/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/815075/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815075/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 [103.22.144.68])\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 3xwvp45jLlz9s7m\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 04:35:40 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xwvp33lcxzDqNh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 04:35:39 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xwvf14GcpzDqXs\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 19 Sep 2017 04:28:41 +1000 (AEST)","from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8IIOHbi063535\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 18 Sep 2017 14:28:39 -0400","from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d2hacfq2w-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 18 Sep 2017 14:28:39 -0400","from localhost\n\tby e14.ny.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\tMon, 18 Sep 2017 14:28:38 -0400","from b01cxnp22033.gho.pok.ibm.com (9.57.198.23)\n\tby e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 18 Sep 2017 14:28:35 -0400","from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com\n\t[9.57.199.110])\n\tby b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v8IISYkV41484422; Mon, 18 Sep 2017 18:28:34 GMT","from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 7C24EAE043;\n\tMon, 18 Sep 2017 14:29:05 -0400 (EDT)","from oc1554177480.ibm.com (unknown [9.53.92.236])\n\tby b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id F418EAE034;\n\tMon, 18 Sep 2017 14:29:04 -0400 (EDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=mwb@linux.vnet.ibm.com; receiver=<UNKNOWN>)","To":"linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org","From":"Michael Bringmann <mwb@linux.vnet.ibm.com>","Subject":"[PATCH 1/2] powerpc/nodes: Ensure enough nodes avail for operations","Organization":"IBM Linux Technology Center","In-Reply-To":"<49626c85-d466-3f99-bde8-f459e278f6ee@linux.vnet.ibm.com>","Date":"Mon, 18 Sep 2017 13:28:33 -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":"17091818-0052-0000-0000-000002635A2B","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007757; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000230; SDB=6.00918904; UDB=6.00461633;\n\tIPR=6.00699131; \n\tBA=6.00005595; 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.00017198;\n\tXFM=3.00000015; UTC=2017-09-18 18:28:36","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091818-0053-0000-0000-0000520C54B4","Message-Id":"<d62dd6c7-7676-5fe0-4f63-baada9213908@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-18_07:, , 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-1709180260","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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":"powerpc/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 lowest domain level (number of\nallocable resources) from the \"rtas\" device tree property\n\"ibm,current-associativity-domains\" or the device tree property\n\"ibm,max-associativity-domains\" to use as the maximum number of nodes\nto setup as possibly available in the system.  This new setting will\noverride the 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---\n arch/powerpc/mm/numa.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)","diff":"diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c\nindex ec098b3..b385cd0 100644\n--- a/arch/powerpc/mm/numa.c\n+++ b/arch/powerpc/mm/numa.c\n@@ -892,6 +892,51 @@ 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,\n+\t\t\t\t\t\"ibm,current-associativity-domains\", &len);\n+\t\tif (!prop || len < sizeof(unsigned int)) {\n+\t\t\tprop = of_get_property(rtas,\n+\t\t\t\t\t\"ibm,max-associativity-domains\", &len);\n+\t\t\tgoto endit;\n+\t\t}\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\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 (mcd = %d)\\n\", numnodes,\n+\t\t\tmin_common_depth);\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@@ -911,6 +956,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":["1/2"]}