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 621A3C001DB for ; Tue, 8 Aug 2023 06:15:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCA446B007B; Tue, 8 Aug 2023 02:15:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7A0D8D0002; Tue, 8 Aug 2023 02:15:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C41E78D0001; Tue, 8 Aug 2023 02:15:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B503C6B007B for ; Tue, 8 Aug 2023 02:15:21 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7EAD1140B6F for ; Tue, 8 Aug 2023 06:15:21 +0000 (UTC) X-FDA: 81099925242.12.9F9E9D3 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf14.hostedemail.com (Postfix) with ESMTP id 9C21C100016 for ; Tue, 8 Aug 2023 06:15:18 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="Xl/mJrKF"; spf=pass (imf14.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@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=1691475319; 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=tNLJ7oP0DHlAbP1b+ZVt3ZWifaoyi1CX5SuOmwo6U7k=; b=19HedCJoZddFij0KigK1sfBGM39ztd5/0YrQKDA5OATnpUL80HYNIcyDtsj8zSIMdvxen2 lvSImit3EVzCH7hCt7PrC4/GInI4MLAyO0xnSDAi1sQAQq4t5BgNXZkLXlDHV4X1qO1VXx oRyn/MKViyjUDj8zTXHG8ZDY1TsbnCk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691475319; a=rsa-sha256; cv=none; b=bqFmduPnbUQJXMeE58hchlvRZhny+C6E5dfGNOAybRDRwzlQou/2JeWrfkUZmUR0OlwvHB H68nWDUnIcWXLSHksjNA+L/7PHP48DWJjrToKm1VJk/19pKDLlIGeaWLHhSkwJrR/d5Ywa SfJ2EqOfGcLBjAdTKvw1Gk9TFrr4jbw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="Xl/mJrKF"; spf=pass (imf14.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3786EOC9029456; Tue, 8 Aug 2023 06:15:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=tNLJ7oP0DHlAbP1b+ZVt3ZWifaoyi1CX5SuOmwo6U7k=; b=Xl/mJrKFrniQOf1oKzc5ZydXGTJYm6aNgOSeJSQ1f7ALJBd8fSRmUoVgkoq7qi3tKbLp 5T1UjvIE1sCgwLJPWXwlWkiDUVlBbfQfDbFUuCW5eV44JY1piHS7UYbibS4w1o1dNpb+ pwPrkeFFG8F4pKJOiRleWO7C+A1rewvvGzMLQMpoddEnqIn2heZv6MUsm4Q/fFdmq2f1 3WS0y0bnwjJCk7hQ5MzXkiZWfhPu6WJsyHveDObkaX+ITQ2npA09Q8TCNBl4Wruqqv5x v43vc2+EGXwwuyZZ3Tl/stRKQzCw21W1F5jRws/AMvMmF450GzLSTOKxoXQe29Wajlvi 4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sbg2brb4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 06:15:07 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3786ERKi029523; Tue, 8 Aug 2023 06:14:36 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 3sbg2br9gn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 06:14:34 +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 3785Ruq0015354; Tue, 8 Aug 2023 06:09:47 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3sb3f2nhy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 06:09:47 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 37869iME30671332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Aug 2023 06:09:45 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B750A2004E; Tue, 8 Aug 2023 06:09:44 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E39D420043; Tue, 8 Aug 2023 06:09:42 +0000 (GMT) Received: from [9.109.212.144] (unknown [9.109.212.144]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Aug 2023 06:09:42 +0000 (GMT) Message-ID: Date: Tue, 8 Aug 2023 11:39:41 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v7 7/7] mm/memory_hotplug: Enable runtime update of memmap_on_memory parameter Content-Language: en-US To: David Hildenbrand , Michal Hocko Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu, Oscar Salvador , Vishal Verma References: <31305ab7-1e65-80aa-ee91-9190c8f67430@redhat.com> <1c6a74f0-85e9-5299-1520-9068e842b1a5@redhat.com> From: Aneesh Kumar K V In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 00LLm1CbxmxJ4JJdlQG2d82cR0AuHfgg X-Proofpoint-ORIG-GUID: g9FQUUpzu-nfcsHw-h90ubHu6fcwniZy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-08_04,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=525 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308080054 X-Stat-Signature: s4oifaje7cwyq3smqazixabeioe6togc X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9C21C100016 X-Rspam-User: X-HE-Tag: 1691475318-316055 X-HE-Meta: U2FsdGVkX19ywVEOQXvvpYR3IglTyxoveb2Y/70gDGPj+yCh1aliBM7BpF7UJLnLbixkCAoLAht6QGFlCszQYYJpr2nJAFl3nKl/T+pll/DQXOO48WUG0pocpm0eM3LDjraSJ+6f0T2RAxwwpA1YOhPGjPI7PsJwTGNIT/nozQ4cJu/AIXUoh4Y2dUlybo1Wm4RHVUenYXduwhZpmA3j+Fs7g3scldM8m+KG2PfSB50y1uN9As/J4/WGC/Rb8SOAkEt5uy7appHZFlCwFEYavhHLu6fCz6SXd9mLH2DKSCnqDIrAIxsG7NW2GL7l19m8ack2T1FS6kJuG20vr+E3wPG19J2ZzSyd21WtSAdESw7ypz1iBILAgPCQWQVdcCfxIYt+6zhrouJH88mHms/qElBXLp9LTzbZ9/Lnlx3QB+56cufg3Bu1oD/9RC7lCZEojNd+91oHmSLzJ9woukgfEwbSd17qCwhrK01ZdAE3ptDwYqfvA8D+xkvqAZBTq8aLC5ArIsm+oKtSy9i4ozszEAlR+RT+oh839903VRxy+vfp1WHeHaGH5bGTiVmhseWXaBZyy/X5svPe20bXFeECUn5CMYDuEv5mRHfITc/CXw/F7l2JdC6xShHHsyf22n5IDYzzDzGItSEfZhtucZMOtG6gDrso0f8PhTTpxwjEt8k5cooshdB/S0jAnozkuvpWJ4Uc9IqLVlEvIoh24MqzW01ssgPsktm28sz39hAIRMjc0q6iEGDjr2IlKHS+j7UhaS4FtEubA1vPFSAYSDbzRT6r3wJmvCc+RW0QeMSPrfdgQz3HF3ZzLTd9KPldfOak38eZCDjWEsUwsmrvGWo6gsoa7mlmv1u+ttuisjPTUsvUez+805LqZ2at9JaiS5EFll4nTd8j7VFuKV/DEjwuFhvPNwFF1yyWMMc/D6Uc+ZmDdq4yUSZnzXIlxMfrx4v5kDI/2NhrdLVAbVPE1pc nqu5D4iB vW7hYCaEtJwZ190T5vMOuT6MCqh5klJXUjx0j2PSMJNSNiw7ZZia8c88ohLFoh8ivLnzqC3EvsoeH7j6o3iVOSiK2DzIj/Xc7l7NDKc3566XJXpHfXU7oyMxWF0HfGN4p5Xvik0sCrsVrwdjmihAMeV2m5hPjmj2uhQvV2JY4EO/xSjLVerwpJKHnx7DZailtj8w8uPIpDfNTSKWZFj7/Wy8MhU+ns/zn/M5duD4pg6P76Ouo/ZayByO24DJQGr/VlTZFQJ7guXVD7cyzTkCjBmYlOXeioxi17snE4OCXjWaELJg= 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: On 8/8/23 12:05 AM, David Hildenbrand wrote: > On 07.08.23 14:41, David Hildenbrand wrote: >> On 07.08.23 14:27, Michal Hocko wrote: >>> On Sat 05-08-23 19:54:23, Aneesh Kumar K V wrote: >>> [...] >>>> Do you see a need for firmware-managed memory to be hotplugged in with >>>> different memory block sizes? >>> >>> In short. Yes. Slightly longer, a fixed size memory block semantic is >>> just standing in the way and I would even argue it is actively harmful. >>> Just have a look at ridicously small memory blocks on ppc. I do >>> understand that it makes some sense to be aligned to the memory model >>> (so sparsmem section aligned). In an ideal world, memory hotplug v2 >>> interface (if we ever go that path) should be physical memory range based. >> >> Yes, we discussed that a couple of times already (and so far nobody >> cared to implement any of that). >> >> Small memory block sizes are very beneficial for use cases like PPC >> dlar, virtio-mem, hyperv-balloon, ... essentially in most virtual >> environments where you might want to add/remove memory in very small >> granularity. I don't see that changing any time soon. Rather the opposite. >> >> Small memory block sizes are suboptimal for large machines where you >> might never end up removing such memory (boot memory), or when dealing >> with devices that can only be removed in one piece (DIMM/kmem). We >> already have memory groups in place to model that. >> >> For the latter it might be beneficial to have memory blocks of larger >> size that correspond to the physical memory ranges. That might also make >> a memmap (re-)configuration easier. >> >> Not sure if that is standing in any way or is harmful, though. >> > > Just because I thought of something right now, I'll share it, maybe it makes sense. > > Assume when we get add_memory*(MHP_MEMMAP_ON_MEMORY) and it is enabled by the admin: > > 1) We create a single altmap at the beginning of the memory > > 2) We create the existing fixed-size memory block devices, but flag them >    to be part of a single "altmap" unit. > > 3) Whenever we trigger offlining of a single such memory block, we >    offline *all* memory blocks belonging to that altmap, essentially >    using a single offline_pages() call and updating all memory block >    states accordingly. > > 4) Whenever we trigger onlining of a single such memory block, we >    online *all* memory blocks belonging to that altmap, using a single >    online_pages() call. > > 5) We fail remove_memory() if it doesn't cover the same (altmap) range. > > So we can avoid having a memory block v2 (and all that comes with that ...) for now and still get that altmap stuff sorted out. As that altmap behavior can be controlled by the admin, we should be fine for now. > > I think all memory notifiers should already be able to handle bigger granularity, but it would be easy to check. Some internal things might require a bit of tweaking. > > Just a thought. > W.r.t enabling memmap_on_memory for ppc64, I guess I will drop patch 7 and resend the series so that Andrew can pick rest of the patches? -aneesh