From patchwork Mon Nov 26 20:34:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Bringmann X-Patchwork-Id: 1003471 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 433dyr3QcWz9ryk for ; Tue, 27 Nov 2018 07:37:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 433dyr1ZSvzDqQn for ; Tue, 27 Nov 2018 07:37:56 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=mwb@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 433dtn4WNczDqc8 for ; Tue, 27 Nov 2018 07:34:25 +1100 (AEDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAQKYBQC073491 for ; Mon, 26 Nov 2018 15:34:23 -0500 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p0qm8gwwf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 26 Nov 2018 15:34:22 -0500 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Nov 2018 20:34:22 -0000 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 26 Nov 2018 20:34:19 -0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAQKYGZa29360246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Nov 2018 20:34:17 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD110C6059; Mon, 26 Nov 2018 20:34:16 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C5665C6055; Mon, 26 Nov 2018 20:34:16 +0000 (GMT) Received: from ltczep4-lp5.aus.stglabs.ibm.com (unknown [9.40.193.67]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 26 Nov 2018 20:34:16 +0000 (GMT) Received: from ltczep4-lp5.aus.stglabs.ibm.com (localhost [IPv6:::1]) by ltczep4-lp5.aus.stglabs.ibm.com (Postfix) with ESMTP id 76108400C859; Mon, 26 Nov 2018 14:34:16 -0600 (CST) Subject: [Internal Review PATCH 1/3] powerpc/numa: Conditionally online new nodes From: Michael Bringmann To: Michael Bringmann , Michael Ellerman , Juliet Kim , Tyrel Datwyler , Thomas Falcon , Vaidyanathan Srinivasan , Srikar Dronamraju , linuxppc-dev@lists.ozlabs.org Date: Mon, 26 Nov 2018 14:34:16 -0600 In-Reply-To: <20181126203327.11326.32023.stgit@ltczep4-lp5.aus.stglabs.ibm.com> References: <20181126203327.11326.32023.stgit@ltczep4-lp5.aus.stglabs.ibm.com> User-Agent: StGit/0.18-105-g416a-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112620-0016-0000-0000-0000095A81E1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010125; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01123167; UDB=6.00583042; IPR=6.00903297; MB=3.00024341; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-26 20:34:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112620-0017-0000-0000-00004131EBCD Message-Id: <20181126203355.11326.11389.stgit@ltczep4-lp5.aus.stglabs.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-26_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811260175 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 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" Add argument to allow caller to determine whether the node identified for a cpu after an associativity / affinity change should be inited. Signed-off-by: Michael Bringmann --- arch/powerpc/include/asm/topology.h | 2 +- arch/powerpc/mm/numa.c | 6 +++--- arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index a4a718d..4621f40 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -90,7 +90,7 @@ static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} extern int start_topology_update(void); extern int stop_topology_update(void); extern int prrn_is_enabled(void); -extern int find_and_online_cpu_nid(int cpu); +extern int find_and_online_cpu_nid(int cpu, bool must_online); extern int timed_topology_update(int nsecs); extern void __init shared_proc_topology_init(void); #else diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 3a048e9..460d60f 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1197,7 +1197,7 @@ static long vphn_get_associativity(unsigned long cpu, return rc; } -int find_and_online_cpu_nid(int cpu) +int find_and_online_cpu_nid(int cpu, bool must_online) { __be32 associativity[VPHN_ASSOC_BUFSIZE] = {0}; int new_nid; @@ -1210,7 +1210,7 @@ int find_and_online_cpu_nid(int cpu) if (new_nid < 0 || !node_possible(new_nid)) new_nid = first_online_node; - if (NODE_DATA(new_nid) == NULL) { + if (must_online && (NODE_DATA(new_nid) == NULL)) { #ifdef CONFIG_MEMORY_HOTPLUG /* * Need to ensure that NODE_DATA is initialized for a node from @@ -1337,7 +1337,7 @@ int numa_update_cpu_topology(bool cpus_locked) continue; } - new_nid = find_and_online_cpu_nid(cpu); + new_nid = find_and_online_cpu_nid(cpu, true); if (new_nid == numa_cpu_lookup_table[cpu]) { cpumask_andnot(&cpu_associativity_changes_mask, diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 2f8e621..620cb57 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -366,7 +366,7 @@ static int dlpar_online_cpu(struct device_node *dn) != CPU_STATE_OFFLINE); cpu_maps_update_done(); timed_topology_update(1); - find_and_online_cpu_nid(cpu); + find_and_online_cpu_nid(cpu, true); rc = device_online(get_cpu_device(cpu)); if (rc) goto out;