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 Content-Length: 1395 Lines: 40 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