From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753017AbdLDRuy (ORCPT ); Mon, 4 Dec 2017 12:50:54 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40468 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808AbdLDRut (ORCPT ); Mon, 4 Dec 2017 12:50:49 -0500 Date: Mon, 4 Dec 2017 11:50:41 -0600 From: Reza Arbab To: Andrea Reale Cc: zhong jiang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, m.bielski@virtualopensystems.com, arunks@qti.qualcomm.com, mark.rutland@arm.com, scott.branden@broadcom.com, will.deacon@arm.com, qiuxishi@huawei.com, catalin.marinas@arm.com, mhocko@suse.com, realean2@ie.ibm.com Subject: Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device References: <22d34fe30df0fbacbfceeb47e20cb1184af73585.1511433386.git.ar@linux.vnet.ibm.com> <5A17F5DF.2040108@huawei.com> <20171124104401.GD18120@samekh> <5A180DF1.8060009@huawei.com> <20171124142948.GA1966@samekh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20171124142948.GA1966@samekh> Organization: IBM Linux Technology Center User-Agent: NeoMutt/20171027 X-TM-AS-GCONF: 00 x-cbid: 17120417-0016-0000-0000-000007EB5A38 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008152; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000243; SDB=6.00955390; UDB=6.00482856; IPR=6.00735427; BA=6.00005727; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018342; XFM=3.00000015; UTC=2017-12-04 17:50:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120417-0017-0000-0000-00003C84A686 Message-Id: <20171204175040.2vgc6ccdcr5m77hm@arbab-laptop.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-04_06:,, 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712040257 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 24, 2017 at 02:29:48PM +0000, Andrea Reale wrote: >But, at least in my understanding, the implementation is not as >straightfoward as it looks. If I declare a memory node in the fdt, then, >at boot, the kernel will expect that memory to actually be there to be >used: this is not true if I want to plug my dimms only later at runtime. >So I think that declaring the hotpluggable memory in an fdt memory >node might not feasible without changes. On the power arch, we do this today using "linux,usable-memory". memory@10000000000 { device_type = "memory"; reg = <0x100 0x0 0x0 0x80000000>; linux,usable-memory = <0x100 0x0 0x0 0x40000000>; : } The reg range defines the node, but at at boot, memblocks are only created for the linux,usable-memory range. The rest can be hotplugged later. YMMV, because this depends on your arch's implementation of memory_add_physaddr_to_nid(). >One idea could be to add a new property to memory nodes, to specify >what memory is potentially hotplugguable. Somewhat related, there is already a "hotpluggable" property. memory@10040000000 { device_type = "memory"; reg = <0x100 0x40000000 0x0 0x40000000>; hotpluggable; : } This is subtly different from the earlier example. This memory IS present at boot. The hotpluggable property ensures that it resides in ZONE_MOVABLE so it can potentially be removed. -- Reza Arbab From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f200.google.com (mail-yw0-f200.google.com [209.85.161.200]) by kanga.kvack.org (Postfix) with ESMTP id 6DB316B025F for ; Mon, 4 Dec 2017 12:50:51 -0500 (EST) Received: by mail-yw0-f200.google.com with SMTP id r137so8291228ywg.4 for ; Mon, 04 Dec 2017 09:50:51 -0800 (PST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id d5si3408446vkg.202.2017.12.04.09.50.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Dec 2017 09:50:50 -0800 (PST) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB4HoYgu084937 for ; Mon, 4 Dec 2017 12:50:49 -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 2en8w88mtj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 04 Dec 2017 12:50:48 -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, 4 Dec 2017 10:50:47 -0700 Date: Mon, 4 Dec 2017 11:50:41 -0600 From: Reza Arbab Subject: Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device References: <22d34fe30df0fbacbfceeb47e20cb1184af73585.1511433386.git.ar@linux.vnet.ibm.com> <5A17F5DF.2040108@huawei.com> <20171124104401.GD18120@samekh> <5A180DF1.8060009@huawei.com> <20171124142948.GA1966@samekh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20171124142948.GA1966@samekh> Message-Id: <20171204175040.2vgc6ccdcr5m77hm@arbab-laptop.localdomain> Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Reale Cc: zhong jiang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, m.bielski@virtualopensystems.com, arunks@qti.qualcomm.com, mark.rutland@arm.com, scott.branden@broadcom.com, will.deacon@arm.com, qiuxishi@huawei.com, catalin.marinas@arm.com, mhocko@suse.com, realean2@ie.ibm.com On Fri, Nov 24, 2017 at 02:29:48PM +0000, Andrea Reale wrote: >But, at least in my understanding, the implementation is not as >straightfoward as it looks. If I declare a memory node in the fdt, then, >at boot, the kernel will expect that memory to actually be there to be >used: this is not true if I want to plug my dimms only later at runtime. >So I think that declaring the hotpluggable memory in an fdt memory >node might not feasible without changes. On the power arch, we do this today using "linux,usable-memory". memory@10000000000 { device_type = "memory"; reg = <0x100 0x0 0x0 0x80000000>; linux,usable-memory = <0x100 0x0 0x0 0x40000000>; : } The reg range defines the node, but at at boot, memblocks are only created for the linux,usable-memory range. The rest can be hotplugged later. YMMV, because this depends on your arch's implementation of memory_add_physaddr_to_nid(). >One idea could be to add a new property to memory nodes, to specify >what memory is potentially hotplugguable. Somewhat related, there is already a "hotpluggable" property. memory@10040000000 { device_type = "memory"; reg = <0x100 0x40000000 0x0 0x40000000>; hotpluggable; : } This is subtly different from the earlier example. This memory IS present at boot. The hotpluggable property ensures that it resides in ZONE_MOVABLE so it can potentially be removed. -- Reza Arbab -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: arbab@linux.vnet.ibm.com (Reza Arbab) Date: Mon, 4 Dec 2017 11:50:41 -0600 Subject: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device In-Reply-To: <20171124142948.GA1966@samekh> References: <22d34fe30df0fbacbfceeb47e20cb1184af73585.1511433386.git.ar@linux.vnet.ibm.com> <5A17F5DF.2040108@huawei.com> <20171124104401.GD18120@samekh> <5A180DF1.8060009@huawei.com> <20171124142948.GA1966@samekh> Message-ID: <20171204175040.2vgc6ccdcr5m77hm@arbab-laptop.localdomain> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Nov 24, 2017 at 02:29:48PM +0000, Andrea Reale wrote: >But, at least in my understanding, the implementation is not as >straightfoward as it looks. If I declare a memory node in the fdt, then, >at boot, the kernel will expect that memory to actually be there to be >used: this is not true if I want to plug my dimms only later at runtime. >So I think that declaring the hotpluggable memory in an fdt memory >node might not feasible without changes. On the power arch, we do this today using "linux,usable-memory". memory at 10000000000 { device_type = "memory"; reg = <0x100 0x0 0x0 0x80000000>; linux,usable-memory = <0x100 0x0 0x0 0x40000000>; : } The reg range defines the node, but at at boot, memblocks are only created for the linux,usable-memory range. The rest can be hotplugged later. YMMV, because this depends on your arch's implementation of memory_add_physaddr_to_nid(). >One idea could be to add a new property to memory nodes, to specify >what memory is potentially hotplugguable. Somewhat related, there is already a "hotpluggable" property. memory at 10040000000 { device_type = "memory"; reg = <0x100 0x40000000 0x0 0x40000000>; hotpluggable; : } This is subtly different from the earlier example. This memory IS present at boot. The hotpluggable property ensures that it resides in ZONE_MOVABLE so it can potentially be removed. -- Reza Arbab