From patchwork Thu Jun 1 21:33:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reza Arbab X-Patchwork-Id: 769970 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wf0wc5Hl0z9s8J for ; Fri, 2 Jun 2017 07:34:24 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wf0wc4Xn3zDqNp for ; Fri, 2 Jun 2017 07:34:24 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3wf0vS48DtzDqKY for ; Fri, 2 Jun 2017 07:33:24 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v51LSWjM034586 for ; Thu, 1 Jun 2017 17:33:16 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2attus05vu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 01 Jun 2017 17:33:15 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Jun 2017 15:33:15 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 1 Jun 2017 15:33:12 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v51LXCTP8651242; Thu, 1 Jun 2017 14:33:12 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4882A78041; Thu, 1 Jun 2017 15:33:12 -0600 (MDT) Received: from arbab-laptop.localdomain (unknown [9.53.92.248]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 25B3178037; Thu, 1 Jun 2017 15:33:12 -0600 (MDT) Received: from arbab-laptop.localdomain (localhost.localdomain [IPv6:::1]) by arbab-laptop.localdomain (Postfix) with ESMTP id 831A2460E95; Thu, 1 Jun 2017 16:33:10 -0500 (CDT) Date: Thu, 1 Jun 2017 16:33:10 -0500 From: Reza Arbab To: Michael Ellerman Subject: Re: [Patch 2/2]: powerpc/hotplug/mm: Fix hot-add memory node assoc References: <87poeya4dt.fsf@concordia.ellerman.id.au> <8e2417d8-d108-2949-40f2-997d53a3f367@linux.vnet.ibm.com> <87a861a25y.fsf@concordia.ellerman.id.au> <20170525151011.m4ae4ipxbqsj3mn7@arbab-laptop.localdomain> <87zie08ekt.fsf@concordia.ellerman.id.au> <20170526143147.z4lmtrs7vowucbkf@arbab-laptop.localdomain> <87lgpg6xe2.fsf@concordia.ellerman.id.au> <54877b2b-8446-20f6-e316-25af809ae11f@linux.vnet.ibm.com> <87tw402go0.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tw402go0.fsf@concordia.ellerman.id.au> Organization: IBM Linux Technology Center User-Agent: NeoMutt/20170428 (1.8.2) X-TM-AS-GCONF: 00 x-cbid: 17060121-0020-0000-0000-00000C121762 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007155; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00868809; UDB=6.00431827; IPR=6.00648721; BA=6.00005393; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015673; XFM=3.00000015; UTC=2017-06-01 21:33:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060121-0021-0000-0000-00005C9901C9 Message-Id: <20170601213310.uzal6zihfbxazysx@arbab-laptop.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-01_05:, , 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-1703280000 definitions=main-1706010397 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Michael Bringmann , Paul Mackerras , "Aneesh Kumar K.V" , Bharata B Rao , Shailendra Singh , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Sebastian Andrzej Siewior Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Jun 01, 2017 at 07:36:31PM +1000, Michael Ellerman wrote: >I don't think that's what the patch does. It just marks 32 (!?) nodes >as online. Or if you're talking about reverting 3af229f2071f that >leaves you with 256 possible nodes. Both of which are wasteful. To be clear, with Balbir's set the latter is no longer wasteful. >The right fix is to make sure any nodes which are present at boot >remain in the possible map, even if they don't have memory/CPUs >assigned at boot. I'm still hoping 3af229f2071f could indeed be reverted some day, but until then the following would follow your suggestion for our GPU nodes. What do you think? --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -895,6 +895,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) void __init initmem_init(void) { int nid, cpu; + struct device_node *dn; max_low_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT; max_pfn = max_low_pfn; @@ -911,6 +912,18 @@ void __init initmem_init(void) */ nodes_and(node_possible_map, node_possible_map, node_online_map); + /* + * Consider an ibm,coherent-device-memory node possible. Even though + * it is not online at boot, it may be hotplugged later. + */ + for_each_compatible_node(dn, NULL, "ibm,coherent-device-memory") { + nid = of_node_to_nid_single(dn); + if (nid < 0) + continue; + + node_set(nid, node_possible_map); + } + for_each_online_node(nid) { unsigned long start_pfn, end_pfn;