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 33EBAC54754 for ; Tue, 20 May 2025 13:06:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A92F96B0085; Tue, 20 May 2025 09:06:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6B8C6B0088; Tue, 20 May 2025 09:06:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 959796B0089; Tue, 20 May 2025 09:06:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 771896B0085 for ; Tue, 20 May 2025 09:06:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0FBF1BF988 for ; Tue, 20 May 2025 13:06:28 +0000 (UTC) X-FDA: 83463310056.24.0E63E1C Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf12.hostedemail.com (Postfix) with ESMTP id 936A44000E for ; Tue, 20 May 2025 13:06:25 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IlWeZAxe; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf12.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747746385; a=rsa-sha256; cv=none; b=gywGsEyDbFlDg4X9dYabaeTIyb//Une/3B5TN++ODLEi1jqW4lr6cIGJM8hMc1QMHpfdnZ zW6LgkvKkYMQzmpJUXV7bwoPPZplUk9abuqmrqKmLXXwg7NrC973M2JMBlaZKAozjarhb1 f1+7zYh9fyftkKapSKpXxLS+ECBMpPk= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=IlWeZAxe; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf12.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747746385; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Cy5wTSziBQsdtfZ3j8cjf5XwjTaunUcYpjReKuumP8I=; b=RmDbxtFGRgp/FU1x8RLmBV2WVnXtmIU9vF34OmqMwG76m9z1sYaFX/r8q9pZDG8Hn8OxjG /AbuAC39UBsx3edlWxIL9ml5Ak0OB0x/Kdya7qQnH37fChaTKBTTuZbI/QkO7OcJj5MoHB xvqobT3bL79msVsnnAxNnUFW9qVu4x4= Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54K6IKD6016775; Tue, 20 May 2025 13:06:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=Cy5wTS ziBQsdtfZ3j8cjf5XwjTaunUcYpjReKuumP8I=; b=IlWeZAxedET7Z2mOeMuRv9 li3lI16EdCt/dz9rwX0qCCka8ZU+4alIJVojoPwCXML14qAKxg2dcuPbRqFbfaBD aSqUWEEtFt33xYVhk6LMpyISnlG2WCapgPFUJhm1Q4bSQk3BknFIf409nFTAE9X7 VbAIrsFr2xZZ4dwrG4K+rrLX5pz7sghF609G7pAzZAw5xHRQ4gk7T4d99lk8xOLc GEyoxUAkcq1hC1p+JPaOSUD0QWbPmhrSu0B2+x6quBj7qBCFT8jvLBFVj13t/I0K t8JmMr6d3jB0kCHfiV4xd+NYC+PkOU8RPF9jQJ9wLigr8rXihPEVmYXDiJA0aQnQ == Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 46rmbsswt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 May 2025 13:06:24 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 54KApXUE002449; Tue, 20 May 2025 13:06:22 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 46q5snv0e5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 May 2025 13:06:22 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 54KD6I0i28901976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 May 2025 13:06:18 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0ED52004E; Tue, 20 May 2025 13:06:17 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7217A2004B; Tue, 20 May 2025 13:06:17 +0000 (GMT) Received: from li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com (unknown [9.111.35.118]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTPS; Tue, 20 May 2025 13:06:17 +0000 (GMT) Date: Tue, 20 May 2025 15:06:16 +0200 From: Sumanth Korikkar To: David Hildenbrand Cc: linux-mm , Andrew Morton , Oscar Salvador , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , linux-s390 , LKML Subject: Re: [RFC PATCH 1/4] mm/memory_hotplug: Add interface for runtime (de)configuration of memory Message-ID: References: <20241202082732.3959803-1-sumanthk@linux.ibm.com> <20241202082732.3959803-2-sumanthk@linux.ibm.com> <3151b9a0-3e96-4820-b6af-9f9ec4996ee1@redhat.com> <1b9285ba-4118-4572-9392-42ec6ba6728c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1b9285ba-4118-4572-9392-42ec6ba6728c@redhat.com> X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIwMDEwNSBTYWx0ZWRfX0WqjmVSHorLo oxRKIaBoqik08JOTxgRvtRr9+NaMbtdHMGNpIWeUrDtXI8n94s1hTWlde3f3fzkNSOYTnLCRh+e gAOiOEUsrIyQ2ir0+KOGSFnviRP+/+pRnL6Q5nKgQcgY0F9HmXkFU3vZPKArO8dCKpiO0TcPX34 3fAocxMTCJX/obvj9AYOFsx/uU1NHVa8DeSd3UuvdaCXWbrcjxhrq9m2b8ucjzejTgRo8wNF70O xE02HhgbME0sCbhvo73TQRIJGW4ybMZnx24q72uVjuKlFwVzNXn/3ESQK/AktvDbKpH54vFDdz9 0CT9b8EdI/YjbSafiBwnFhparAmctdFncMt9amrBzHbpb4n+trw3jCZZz6jCAALGGDGaaGhsm5m P5savAnGCSxnzYPx59PKokJNU+oWbdWXOdbR2P2z1uwVpY2jf64SVlvTDvz4CeRvF4k/VOpQ X-Proofpoint-ORIG-GUID: OXkGa_xERynWSUNglpmDyrmyuQd-c5Oo X-Proofpoint-GUID: OXkGa_xERynWSUNglpmDyrmyuQd-c5Oo X-Authority-Analysis: v=2.4 cv=DsxW+H/+ c=1 sm=1 tr=0 ts=682c7e50 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=lGm5nveCKM6En4syuT0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-20_05,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 malwarescore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 mlxlogscore=880 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505200105 X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 936A44000E X-Stat-Signature: 9hixnfuzg3bwa9mzrd6ny6mo3tn17esd X-HE-Tag: 1747746385-116857 X-HE-Meta: U2FsdGVkX18xtu/88ILQ2xxRCpmlNZIqV9+QSvmBBlZJqGFPemUdqJ2qG+FFTaOz2i9yS/C+J1jOTQTchoWASFQSnNripI1Xnn70vH8lapXK5bG2wQ476msjqQpu5fnMId+c1QsszwDkUgxi/DRVhVjB9xBGX9QJiyTXnz9yJirmcyxDrChmzRK1+eVpYu4cFfA8oBwpcNuifWt/Je//BfP71Aqh3n9ddPPK1OnejYBWphYusl4r21sXjMnlVCRjHLr8gTuWbcx5IVbB3OWS6ZFFi7aFicCYplrCWf2LWgvhqBlTPbHRcvLolG/KTFFnuSkBXNRpGO11eUMbiJokmq98NLMgjuToD/yOiZfYCer89cNCf+KEjJ0UK9yj8twlOMihzrvuRyZ3rFqZ8EHQ/sRzsRCiogRjTH3udA6I5J9HanKEue/8SaXUg76bqBHFXFY78c1B+/Y1GIJbprNq6xsme2WdAr8GyH1V0MhKLasXJoqaoFGFHAFgzGMdafZg+7oGyVyNGQBZXhBLKWKcjBe1Zuxgz19OSQdhOUBeW7rwkkBxIXbrVQYbHZ7bY5Z2sU4Bd71Dtla9USLMXh7DwKpFg6nImlteMAr1X+2sXmXd93Aikk3U0s+EbzuA2TL2s+XPu2hgs1Bxeyun8ky9r4UuV2ErwgeeU6dp+IuzdHV2JTZ1jhdWgXUMgBPuuID3C5bPxmSQXAgv4kc+LtigqrLFTj39v8Ld4yPwE1fXEm4UGSiNvBT9q2f15IzXCWqlr7S31mX1OVo0yEpfq+uy7m5fHelIH7FAqfjBEr6KzFoM9e8+pPHKldCk6wT1wtSD07xH/tRzCpW1owugRS7CH3RLIdwlXpsBxOyDKcWAlx5g6TPAqj4+qYC1J6s5llg3OnWWUVRbLOhzV4GDqwELkLeLpTi2JcmfA7Ji3Orlt1mkdej4K/ADFX08d8TaJAHxZoOqBZgcrmAJ1gg4TiJ 5eO7BYE2 sILnTDzaEBlk5ZoVyjeT/22YKSHtvdPW4IuFn9JGJge2Z2YUK1vVCGUWmpKt8D8UMeVUurnQah90f5t+P+tiA17cRCkmFQbzhR7TjDXbZ31sNdlAjnEgAw5xZn7xAYrj030HgkPd2d27ZaukfltqreWhPB0h0S8/S2ROHYGV/eDaaUQvmUITTI8H4EP1+qcykzvVbouiDt1oIN0/fPj3LWacNAjZwyLXitjDf2F54N+NYt7dXCfOs9zBDqh0oqtJxB09z/b26ASZHt3EPkq/TYSd8Pp9TyxAd1XixBrLpUbCdhXo= 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: > Maybe "standby memory" might make it clearer. The concept is s390x specific, > and it will likely stay s390x specific. > > I like the idea (frontend/tool interface), all we need is a way for these > commands to detect ranges and turn them from standby into usable memory. > > > > > The user can still determine the available memory ranges and make them > > configurable using tools like lsmem or chmem with this approach atleast > > on s390 with this approach. > > > > > My thinking was that s390x would expose the standby memory ranges somewhere > > > arch specific in sysfs. From there, one could simply trigger the adding > > > (maybe specifying e.g, memmap_on_memory) of selected ranges. Hi David, Sorry for the late reply. Potential design approach for enabling dynamic configuration and deconfiguration of hotplug memory with support for both altmap and non-altmap usage. Introduces flexibility, allowing users to specify at runtime which memory ranges should utilize altmap, rather than relying on a static system-wide setting that applies uniformly to all hotplugged memory. Introduce new interface on s390 with the following attributes: 1) Attribute1: /sys/firmware/memory/block_size_bytes 2) Attribute2: /sys/firmware/memory/memoryX/config echo 0 > /sys/firmware/memory/memoryX/config -> deconfigure memoryX echo 1 > /sys/firmware/memory/memoryX/config -> configure memoryX 3) Attribute3: /sys/firmware/memory/memoryX/altmap_required echo 0 > /sys/firmware/memory/memoryX/altmap_required -> noaltmap echo 1 > /sys/firmware/memory/memoryX/altmap_required -> altmap echo N > /sys/firmware/memory/memoryX/altmap_required -> variable size altmap grouping (possible future requirements), where N specifies the number of memory blocks that the current memory block manages altmap. There are two possibilities here:       * If the altmap cannot fit entirely within memoryX, it can        extend into memoryX+1, meaning the altmap metadata will span        across multiple memory blocks.       * If the altmap for memory range cannot fit within memoryX,         then config will return -EINVAL. NOTE: “altmap_required” attribute must be set before setting the block as configured via “config” attribute. (Dependancy) 4) Additionally add the patch to check if the memory block is configured with altmap or not. Similar to [RFC PATCH 2/4] mm/memory_hotplug: Add memory block altmap sysfs attribute. Most of the code changes will be s390 specific with this interface. Request your inputs on the potential interface. Thank you. Other questions: 1. I’m just wondering how variable-sized altmap grouping will be structured in the future. Is it organized by grouping the memory blocks that require altmap, with the first memory block storing the altmap metadata for all of them? Or is it possible for the altmap metadata to span across multiple memory blocks? 2. OR, will dedicated memory blocks be used exclusively for altmap metadata, which the memory blocks requiring altmap would then consume? (To prevent fragmentation) ? Thank you, Sumanth