From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10A16C48BF9 for ; Wed, 15 Nov 2023 14:23:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 996036B0369; Wed, 15 Nov 2023 09:23:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 946026B036A; Wed, 15 Nov 2023 09:23:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E69C6B036B; Wed, 15 Nov 2023 09:23:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6F5866B0369 for ; Wed, 15 Nov 2023 09:23:32 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0B30880B33 for ; Wed, 15 Nov 2023 14:23:32 +0000 (UTC) X-FDA: 81460406664.20.7F3FF54 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf14.hostedemail.com (Postfix) with ESMTP id AB9EC100016 for ; Wed, 15 Nov 2023 14:23:29 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mCGZ9e2h; spf=pass (imf14.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700058209; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eTDY6KXlXr2hiadyHyz3mXgboWDGVlfhNlPxNwFUfNE=; b=r+lK+MtoCvYK+Zo1s82bdLmQhYGqXvsNZX0EyBC9XNLftoZXQ/EQEZo+N+WytR7WVBiOyX rntEDpNYzfb5X3MvFVjvVfUBPhFLA888FayagEYfP2pzSAiSvSFGoe01YMTmdzPkc/Zf2f EmqhH3f/OVtoKTpt/Kgm+W1lsXJTwoc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700058209; a=rsa-sha256; cv=none; b=7kmDyiTnROcrO9zVM2C+H7YwlxIyH4NUnaSiXnxNUKUljc3A+2nl8s+Z/7S3DuCeqxCX8n Ium64beMd7LNCvw2bQeK9PbVnHhtv7oaaaD70h1vyPxLLaLcQ9j9Bbg93auXWcgEGFghyq nJVd7/vOqUAJYO4NE2YzaYW1MoCk7kg= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mCGZ9e2h; spf=pass (imf14.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFEB1j9017888; Wed, 15 Nov 2023 14:23:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=eTDY6KXlXr2hiadyHyz3mXgboWDGVlfhNlPxNwFUfNE=; b=mCGZ9e2hFOFICgQyZRXHemtGWxiWpWT/RpyjJZGvf/AGwjMxIehhhozZL1GZeBweAUrO pTpijGXY7ZVgR9N26IczRZScsiXGUtz2C7/LJMM7zwa8sFfsNw6KXAc5ttu9iqZIxzyB O86p/YG+BXfK7i1lsN/yqlOCmnnc4GmBF1idtD+ayQQW7PJV4TyyA9YXl/wKkJtWTzBa J48o4hMRLauJQhHyEKsenLO3DE+p+/gtxBMO4Vd7AwFOYKbf545g23rIKYP/OCyPT0Ye C9Oj+ZChUX++xJYyz7eruvQ4BwNZABS16IQaEm0o8Xto3xJYFi1J3YXKfWd1wOLrnoH7 4g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucyd6rnxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 14:23:25 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AFEFtD6028859; Wed, 15 Nov 2023 14:23:25 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucyd6rnx8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 14:23:24 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFDn7ks028120; Wed, 15 Nov 2023 14:23:23 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uap5k78ex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 14:23:23 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AFENKlB39846474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 14:23:20 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B15E22004D; Wed, 15 Nov 2023 14:23:20 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A22F20040; Wed, 15 Nov 2023 14:23:20 +0000 (GMT) Received: from li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com (unknown [9.171.69.220]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 15 Nov 2023 14:23:20 +0000 (GMT) Date: Wed, 15 Nov 2023 15:23:18 +0100 From: Sumanth Korikkar To: David Hildenbrand Cc: linux-mm , Andrew Morton , Oscar Salvador , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , Gerald Schaefer , Alexander Gordeev , Heiko Carstens , Vasily Gorbik , linux-s390 , LKML Subject: Re: [PATCH 4/8] mm/memory_hotplug: introduce MEM_PHYS_ONLINE/OFFLINE memory notifiers Message-ID: References: <20231114180238.1522782-1-sumanthk@linux.ibm.com> <20231114180238.1522782-5-sumanthk@linux.ibm.com> <7c85bd39-8b34-4b09-b503-b0a2f2e58b88@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c85bd39-8b34-4b09-b503-b0a2f2e58b88@redhat.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ST_UVJkxcN1fi4LUEAUh2L93plw6oxrs X-Proofpoint-ORIG-GUID: ZqaapDjjgDBpfEcGoHT3CKUTOP-x8wy9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_13,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=1 phishscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=1 spamscore=1 mlxlogscore=229 clxscore=1015 suspectscore=0 impostorscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150111 X-Rspamd-Queue-Id: AB9EC100016 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: edbmbznnrnid179ibcs31y1jbgosh1gh X-HE-Tag: 1700058209-861689 X-HE-Meta: U2FsdGVkX1/48dKwrX+txFN2vQ05lttBQIUjdIlhIy8/ViKHzZr5oWckHO5MHhsvz3JnVtSD/BHqlBXjvmQIArV2mLKF2wVkqesD1VN8Pb++gKTol0yEywxRIwZOoXpirMR+MgnyvnSLQ3ISI+Xxt2RhEm88XqPvv0Gv+4Tk9X7afZjnI9pBc5Hep8c3BFSgbSWH5ER7VycvkyEfehAByg4rz5xh0c77h7/I0JWqo8ENIzxYBWJIjGN61VuuORH+QmSbNtpRtTqKv4z9EiHgooDTeNDIWxHzy70RP9CtopQL26gdAQqozkbqF4XrLS5lw1NPAiC9M8R+VPpovgeHkexlze0OxH/n+o0y0KCaVzIT3d3QRsbImBCbeYrMYaHeVE3hfycbPrHi7Q2wuqWWnp+1UISo4skEiGEF51FzZfHAhJcDldPlCsV4nOwTKFHV9J1fxn9lfBMqLYWfgUljqNiAy4ZZCoKMJPKcMlPnBbeEPZWx2xYfMpdZDZEQJ9FMtgqlLi6iJejnsarBapEJ5lZypuYwTtcpio/NqH90O8zNrNSXHwQ23HL4p9Y5D0jBVW9pCpq3pjFGmGNgW0drV5cEzWd6tRfPyF/TTFioqv/rd8y+KUNUBYsNSOkzd+TQjgqYSiRFQIF0zRckcwE+6FFvEdYKaWJHVKkKufJOAP5JqITY3+N9kfZcBCtMvr5FilmaXT51eERXnK9KZxQwDP8h8k02dFokn7k+Vb/ji1x495dwOMBriac0mHEIUF6yY6UTFFa8Vj2ym6vvv3c6XEuUUjyhZ9BsB+J/Ke0J3iToKbzzakU8DTXiH6Aa2sAJNtgFFFmFzm1aXS0DEhx2U49+b/mq+twKaF5cEw+yWdcQWGR8g5UjYVjCJXwJ1RWfKyyBCW6VsYhOSHhgCCHZA1f9SlWdjyYNLtUPXQdQfjhTjMTJ/Z26daCVDjlLDJhSc4ER/pbYwxo0ZBwr4Fo IfF3kuAx 4eOm8tZ1b1zMXukLAGnbcn2AOTvNWcORQfE6t4A6+DnPK1pAutAsAvl/TOOQoj6J8D9jXtNscT3Wr3iaHyIqZNDZbjVEO6ido+XOLE53lQ+eBUs/67Z9W8bZ3QQG34eHOkv/Q9lFPjJRqfZwv+t5QBmDjzmJsqAF6ZDlmy/oVpKQy8BBSE8HzGDqodSdwbZGw0knOqqGLXfjZ+6MqoGuGo7IVbvm9zVHaHGaPpejaiyx85cHbmMH3QYRLXXMVZPLOvRE+qwzIwV9MUFJn/H1c+F0O/MPKSxKRBLTSJBZufuQCTzPWEATRbU31iQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 14, 2023 at 07:27:35PM +0100, David Hildenbrand wrote: > On 14.11.23 19:02, Sumanth Korikkar wrote: > > Add new memory notifiers to mimic the dynamic ACPI event triggered logic > > for memory hotplug on platforms that do not generate such events. This > > will be used to implement "memmap on memory" feature for s390 in a later > > patch. > > > > Platforms such as x86 can support physical memory hotplug via ACPI. When > > there is physical memory hotplug, ACPI event leads to the memory > > addition with the following callchain: > > acpi_memory_device_add() > > -> acpi_memory_enable_device() > > -> __add_memory() > > > > After this, the hotplugged memory is physically accessible, and altmap > > support prepared, before the "memmap on memory" initialization in > > memory_block_online() is called. > > > > On s390, memory hotplug works in a different way. The available hotplug > > memory has to be defined upfront in the hypervisor, but it is made > > physically accessible only when the user sets it online via sysfs, > > currently in the MEM_GOING_ONLINE notifier. This requires calling > > add_memory() during early memory detection, in order to get the sysfs > > representation, but we cannot use "memmap on memory" altmap support at > > this stage, w/o having it physically accessible. > > > > Since no ACPI or similar events are generated, there is no way to set up > > altmap support, or even make the memory physically accessible at all, > > before the "memmap on memory" initialization in memory_block_online(). > > > > The new MEM_PHYS_ONLINE notifier allows to work around this, by > > providing a hook to make the memory physically accessible, and also call > > __add_pages() with altmap support, early in memory_block_online(). > > Similarly, the MEM_PHYS_OFFLINE notifier allows to make the memory > > inaccessible and call __remove_pages(), at the end of > > memory_block_offline(). > > > > Calling __add/remove_pages() requires mem_hotplug_lock, so move > > mem_hotplug_begin/done() to include the new notifiers. > > > > All architectures ignore unknown memory notifiers, so this patch should > > not introduce any functional changes. > > Sorry to say, no. No hacks please, and this is a hack for memory that has > already been added to the system. > > If you want memory without an altmap to suddenly not have an altmap anymore, > then look into removing and readding that memory, or some way to convert > offline memory. Sorry, I couldnt get the context. Could you please give me more details? Thanks