From patchwork Tue Nov 27 21:56:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Bringmann X-Patchwork-Id: 1004060 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 434Hhy3Twvz9s3Z for ; Wed, 28 Nov 2018 08:58:10 +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 434Hhy1g9TzDqpf for ; Wed, 28 Nov 2018 08:58:10 +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 434Hg3084xzDqjg for ; Wed, 28 Nov 2018 08:56:30 +1100 (AEDT) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wARLi5uA017764 for ; Tue, 27 Nov 2018 16:56:28 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p1dvg0suy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Nov 2018 16:56:28 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Nov 2018 21:56:27 -0000 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Nov 2018 21:56:25 -0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wARLuO7517825804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Nov 2018 21:56:24 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC5BBAE067; Tue, 27 Nov 2018 21:56:24 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F906AE060; Tue, 27 Nov 2018 21:56:24 +0000 (GMT) Received: from ltczep4-lp5.aus.stglabs.ibm.com (unknown [9.40.193.67]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 27 Nov 2018 21:56:24 +0000 (GMT) Received: from ltczep4-lp5.aus.stglabs.ibm.com (localhost [IPv6:::1]) by ltczep4-lp5.aus.stglabs.ibm.com (Postfix) with ESMTP id 0E91A400C857; Tue, 27 Nov 2018 15:56:24 -0600 (CST) Subject: [PATCH] powerpc/numa: Ensure nodes are inited for mem changes From: Michael Bringmann To: linuxppc-dev@lists.ozlabs.org, mwb@linux.vnet.ibm.com Date: Tue, 27 Nov 2018 15:56:23 -0600 User-Agent: StGit/0.18-105-g416a-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112721-0040-0000-0000-000004994AC4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010133; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01123675; UDB=6.00577119; IPR=6.00903804; MB=3.00024359; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-27 21:56:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112721-0041-0000-0000-000008A26071 Message-Id: <20181127215610.3111.59806.stgit@ltczep4-lp5.aus.stglabs.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-27_18:, , 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=832 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811270183 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: , Cc: Juliet Kim , Thomas Falcon , Tyrel Datwyler , Srikar Dronamraju Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch fixes some problems encountered at runtime where changes to memory affinity changes reference nodes that were not initialized during system execution after boot. We are initializing a node description that may be subsequently used for memory or CPUs before it can be referenced as invalid. Signed-off-by: Michael Bringmann --- arch/powerpc/mm/numa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index d9109e0..f3714fa 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1026,6 +1026,11 @@ int hot_add_scn_to_nid(unsigned long scn_addr) pr_debug("new nid %d for %#010lx\n", nid, scn_addr); } + if (NODE_DATA(nid) == NULL) { + if (try_online_node(nid)) + nid = first_online_node; + } + return nid; }