From patchwork Mon Nov 27 08:20:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumanth Korikkar X-Patchwork-Id: 13469258 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 2750AC07D5A for ; Mon, 27 Nov 2023 08:20:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9E966B0313; Mon, 27 Nov 2023 03:20:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FE4A6B0314; Mon, 27 Nov 2023 03:20:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82B536B0316; Mon, 27 Nov 2023 03:20:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 75C9F6B0313 for ; Mon, 27 Nov 2023 03:20:36 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 53D1EB523A for ; Mon, 27 Nov 2023 08:20:36 +0000 (UTC) X-FDA: 81503037672.25.4A9D372 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf25.hostedemail.com (Postfix) with ESMTP id 12305A0015 for ; Mon, 27 Nov 2023 08:20:33 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=oUXWfoZk; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf25.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701073234; a=rsa-sha256; cv=none; b=xBfrY+IFFOp4etvmDtNNsHphwfeeouuk2rELPrKHkkBMFPFVwT6MAiFfTD2EXhnupmF69f UqezKM+mkKvdCACgXH0rpqvT4sW15GuELGU9i57AVoy44jdnRmol9qFKJdG3SQ7bxYyHI7 JL/UXAKzKmpKlof3U7wJrF+qu6BkJHI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=oUXWfoZk; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf25.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 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=1701073234; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rjbWOV+O1ljevTy+J9147SeQ96fWv3aAURFylmdeCzc=; b=WiA25ToKPfBcI9vEWS8o1xJuC6WetGqUTRGnz+2jB42LrC7uGFFf+hWNcyv+0691CaHV5N sK32bvWYRIxHm/wM8PwAD5Qgtgxl8jsoAEeSftIRMzi+AvWLpBYnuNmkRwDnDuJf/hygdS UmBzk4An9/AjZbx/3xXZH3xqDxWXWZ8= Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AR8AV4H001140; Mon, 27 Nov 2023 08:20:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=rjbWOV+O1ljevTy+J9147SeQ96fWv3aAURFylmdeCzc=; b=oUXWfoZkf7oKrzD/Wg5OhjctwoTnmPLGpjBkOVzpX/pTUJYyNRQzqr2vT8hUFG8PIl48 3vsRvgp+r0nyrYq1ktoqxqp/kht9Q4EsWbDmvxxlbs5jZR9zBcSATZTsYzWW5Ybgv0/x POQH0oTo9A0NhQGApvhkgfzelrdBBw6GgGY4zBBokoLegYqRANlhz83bajGbbIeI5hds 0sB0JRLvdksU7RAhgxOBNYJ+ZyUtfqh+dt+IZmWyQBdHALsUTYxK659VhFXwaMlDqvdu LV1BDgcSMOWzoJqmW76beP4k9sqpFmzmKHmWKepPOcSVxnFC0MVHOCwZ/sVOrp0DflEy 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3umgdj8pqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:31 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AR7b3RY003560; Mon, 27 Nov 2023 08:20:30 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3umgdj8pqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:30 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AR8JQph015209; Mon, 27 Nov 2023 08:20:29 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ukumy7erm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:29 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AR8KQTL15401632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2023 08:20:26 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 23B4D20043; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6FED2004B; Mon, 27 Nov 2023 08:20:25 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Nov 2023 08:20:25 +0000 (GMT) From: Sumanth Korikkar To: linux-mm , Andrew Morton , David Hildenbrand Cc: Oscar Salvador , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , Gerald Schaefer , Sumanth Korikkar , Alexander Gordeev , Heiko Carstens , Vasily Gorbik , linux-s390 , LKML Subject: [PATCH v3 1/5] mm/memory_hotplug: introduce MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE notifiers Date: Mon, 27 Nov 2023 09:20:19 +0100 Message-Id: <20231127082023.2079810-2-sumanthk@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231127082023.2079810-1-sumanthk@linux.ibm.com> References: <20231127082023.2079810-1-sumanthk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: zcDs7BfQzddJKfSR_RpcgK_O32Wz1kFy X-Proofpoint-GUID: pBk2ZmKESctOTEL2Ixv74m1WWfe5AYPr 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-27_06,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=504 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311270057 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 12305A0015 X-Stat-Signature: 7mgyghnra5kpwya7d9nqhuse67m4t5a6 X-HE-Tag: 1701073233-270414 X-HE-Meta: U2FsdGVkX18qkZzCak5Jn+J8HcRBLFFFY4m4sO85KMR76sXhEfiCX/Zc4SSi2EQPzOFeeB+QeC8a56ZwvwCUyMwqaSlHq/d+z8YUVN4BReb4HaaKL2HJoPc7eADaay8EQadOk+uT+fiXZ+K2/GJbBZ3261qfgLbis9bEmgX7IjPD0Z6N7Rj+hEBRuehnHDInLC9qrrjG/Hk2nweQN1iPvHzdUJDhuIwo4WSUrzGJW+RX04Hpru4zdo1iByK2HszRAowHGfdsfGxkoq5YAiFoW/xvCsO6G++ML9Ker4oM1Gh5PXRZZAwlbm8Bg1D67wm8VFUIoeXdcSI9xWP9+ssmNbOi1JB1/Mq4BgCfKcQPPNxCS5mt0A/RUfbMLXmTSujg/Hu6jDJeUgiRVC9H5sYUHMAQpISRAZpqSwN0iddBc8yErGc/dJe4Q9Nqc0NIn+B1IHwivTOuz5JSjRPF0bXL5X3b5I82cEGj9wyuQWiRYVX0sllmMy4X+WIFlMivTaxswL83HV3g/w8JkP1DAQEzWL+9QoZvpCjbvpd2PCIvLkZoD9Zp5aFktcxatPoR6zT2K0C5cY2iDPS9aaSNMY3sJ3Pr9IExqK2YNdOtDy2mwewDUgi2PavZjl1gKYaWJUg3G3ataTfIpGqDM19dI0AOw3mXRKt1oRpqoqIh57K2qKmtDOK8GWwJQ3Y8ulSX3D1hZ7eax+oeRGWbqufYyGxVw1PMUtDiKuR6Gv9E9jniFH3yLfYexVwki5myLsgY1nXWD07YOjxsCByJl+DGFXP1iqlpOoW0q0SaWvjB5LCmjO35LydRxxcOKH1kRmKk6q/XBqoYZqWi+ErFXdXGZdSO1nkVsk1PRM1fP++IjMQs1BBgXYkP9WVQydzJqEeBkU3xoAX38u3iLg3JG8wLvRn1G6tdT/J8bho+F5Dyq9oqPSflsbme6gzwef3twkqJVUQCL2yuu84ruvN3IICuNCJ 5SMu79RZ SHZp2BZEckivb+dSKU2vuWJJy4K8XQU1ezHChLdHGMzZEl8VzcOW5EeV0pqTsmfhwFyT/NjL4XDob5mr46wZGVdzrRt+dwUqKBWsgHNyrfLhUxz0Od2MlyiBnJ8iHZD1V0SBBPTOra8HJD8NBHn/TXRzMCGEsAlEth5ujFYvW4FO/YRhJPt+zallmHaOsupjPK/LDh9Kc8We1yEjg7r6MPHEUSw== 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: Introduce MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE memory notifiers to prepare the transition of memory to and from a physically accessible state. This enhancement is crucial for implementing the "memmap on memory" feature for s390 in a subsequent 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 is too late and "memmap on memory" initialization is performed before calling MEM_GOING_ONLINE notifier. During the memory hotplug addition phase, altmap support is prepared and during the memory onlining phase s390 requires memory to be physically accessible and then subsequently initiate the "memmap on memory" initialization process. The memory provider will handle new MEM_PREPARE_ONLINE / MEM_FINISH_OFFLINE notifications and make the memory accessible. The mhp_flag MHP_OFFLINE_INACCESSIBLE is introduced and is relevant when used along with MHP_MEMMAP_ON_MEMORY, because the altmap cannot be written (e.g., poisoned) when adding memory -- before it is set online. This allows for adding memory with an altmap that is not currently made available by a hypervisor. When onlining that memory, the hypervisor can be instructed to make that memory accessible via the new notifiers and the onlining phase will not require any memory allocations, which is helpful in low-memory situations. All architectures ignore unknown memory notifiers. Therefore, the introduction of these new notifiers does not result in any functional modifications across architectures. Suggested-by: Gerald Schaefer Suggested-by: David Hildenbrand Signed-off-by: Sumanth Korikkar --- drivers/base/memory.c | 21 +++++++++++++++++++-- include/linux/memory.h | 2 ++ include/linux/memory_hotplug.h | 18 +++++++++++++++++- include/linux/memremap.h | 1 + mm/memory_hotplug.c | 30 ++++++++++++++++++++++++++++-- mm/sparse.c | 3 ++- 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 8a13babd826c..5c6b2af75db4 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -188,6 +188,7 @@ static int memory_block_online(struct memory_block *mem) unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr); unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; unsigned long nr_vmemmap_pages = 0; + struct memory_notify arg; struct zone *zone; int ret; @@ -197,6 +198,14 @@ static int memory_block_online(struct memory_block *mem) zone = zone_for_pfn_range(mem->online_type, mem->nid, mem->group, start_pfn, nr_pages); + arg.start_pfn = start_pfn; + arg.nr_pages = nr_pages; + mem_hotplug_begin(); + ret = memory_notify(MEM_PREPARE_ONLINE, &arg); + ret = notifier_to_errno(ret); + if (ret) + goto out_notifier; + /* * Although vmemmap pages have a different lifecycle than the pages * they describe (they remain until the memory is unplugged), doing @@ -207,9 +216,9 @@ static int memory_block_online(struct memory_block *mem) if (mem->altmap) nr_vmemmap_pages = mem->altmap->free; - mem_hotplug_begin(); if (nr_vmemmap_pages) { - ret = mhp_init_memmap_on_memory(start_pfn, nr_vmemmap_pages, zone); + ret = mhp_init_memmap_on_memory(start_pfn, nr_vmemmap_pages, + zone, mem->altmap->inaccessible); if (ret) goto out; } @@ -231,7 +240,11 @@ static int memory_block_online(struct memory_block *mem) nr_vmemmap_pages); mem->zone = zone; + mem_hotplug_done(); + return ret; out: + memory_notify(MEM_FINISH_OFFLINE, &arg); +out_notifier: mem_hotplug_done(); return ret; } @@ -244,6 +257,7 @@ static int memory_block_offline(struct memory_block *mem) unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr); unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; unsigned long nr_vmemmap_pages = 0; + struct memory_notify arg; int ret; if (!mem->zone) @@ -275,6 +289,9 @@ static int memory_block_offline(struct memory_block *mem) mhp_deinit_memmap_on_memory(start_pfn, nr_vmemmap_pages); mem->zone = NULL; + arg.start_pfn = start_pfn; + arg.nr_pages = nr_pages; + memory_notify(MEM_FINISH_OFFLINE, &arg); out: mem_hotplug_done(); return ret; diff --git a/include/linux/memory.h b/include/linux/memory.h index f53cfdaaaa41..de802994a8fa 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -96,6 +96,8 @@ int set_memory_block_size_order(unsigned int order); #define MEM_GOING_ONLINE (1<<3) #define MEM_CANCEL_ONLINE (1<<4) #define MEM_CANCEL_OFFLINE (1<<5) +#define MEM_PREPARE_ONLINE (1<<6) +#define MEM_FINISH_OFFLINE (1<<7) struct memory_notify { unsigned long start_pfn; diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 7d2076583494..ee00015575aa 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -106,6 +106,22 @@ typedef int __bitwise mhp_t; * implies the node id (nid). */ #define MHP_NID_IS_MGID ((__force mhp_t)BIT(2)) +/* + * The hotplugged memory is completely inaccessible while the memory is + * offline. The memory provider will handle MEM_PREPARE_ONLINE / + * MEM_FINISH_OFFLINE notifications and make the memory accessible. + * + * This flag is only relevant when used along with MHP_MEMMAP_ON_MEMORY, + * because the altmap cannot be written (e.g., poisoned) when adding + * memory -- before it is set online. + * + * This allows for adding memory with an altmap that is not currently + * made available by a hypervisor. When onlining that memory, the + * hypervisor can be instructed to make that memory available, and + * the onlining phase will not require any memory allocations, which is + * helpful in low-memory situations. + */ +#define MHP_OFFLINE_INACCESSIBLE ((__force mhp_t)BIT(3)) /* * Extended parameters for memory hotplug: @@ -154,7 +170,7 @@ extern void adjust_present_page_count(struct page *page, long nr_pages); /* VM interface that may be used by firmware interface */ extern int mhp_init_memmap_on_memory(unsigned long pfn, unsigned long nr_pages, - struct zone *zone); + struct zone *zone, bool mhp_off_inaccessible); extern void mhp_deinit_memmap_on_memory(unsigned long pfn, unsigned long nr_pages); extern int online_pages(unsigned long pfn, unsigned long nr_pages, struct zone *zone, struct memory_group *group); diff --git a/include/linux/memremap.h b/include/linux/memremap.h index 744c830f4b13..9837f3e6fb95 100644 --- a/include/linux/memremap.h +++ b/include/linux/memremap.h @@ -25,6 +25,7 @@ struct vmem_altmap { unsigned long free; unsigned long align; unsigned long alloc; + bool inaccessible; }; /* diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 7a5fc89a8652..ac7cfc09502d 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1083,8 +1083,25 @@ void adjust_present_page_count(struct page *page, struct memory_group *group, group->present_kernel_pages += nr_pages; } +static void page_init_poison_with_resched(unsigned long start_pfn, unsigned long nr_pages) +{ + const unsigned long end_pfn = start_pfn + nr_pages; + unsigned long pfn, cur_nr_pages; + + /* Poison struct pages because they are now uninitialized again. */ + for (pfn = start_pfn; pfn < end_pfn; pfn += cur_nr_pages) { + cond_resched(); + + /* Select all remaining pages up to the next section boundary */ + cur_nr_pages = + min(end_pfn - pfn, SECTION_ALIGN_UP(pfn + 1) - pfn); + page_init_poison(pfn_to_page(pfn), + sizeof(struct page) * cur_nr_pages); + } +} + int mhp_init_memmap_on_memory(unsigned long pfn, unsigned long nr_pages, - struct zone *zone) + struct zone *zone, bool mhp_off_inaccessible) { unsigned long end_pfn = pfn + nr_pages; int ret, i; @@ -1092,7 +1109,14 @@ int mhp_init_memmap_on_memory(unsigned long pfn, unsigned long nr_pages, ret = kasan_add_zero_shadow(__va(PFN_PHYS(pfn)), PFN_PHYS(nr_pages)); if (ret) return ret; - + /* + * Memory block is accessible at this stage and hence poison the struct + * pages now. If the memory block is accessible during memory hotplug + * addition phase, then page poisining is already performed in + * sparse_add_section(). + */ + if (mhp_off_inaccessible) + page_init_poison_with_resched(pfn, nr_pages); move_pfn_range_to_zone(zone, pfn, nr_pages, NULL, MIGRATE_UNMOVABLE); for (i = 0; i < nr_pages; i++) @@ -1439,6 +1463,8 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) if (mhp_flags & MHP_MEMMAP_ON_MEMORY) { if (mhp_supports_memmap_on_memory(size)) { mhp_altmap.free = memory_block_memmap_on_memory_pages(); + if (mhp_flags & MHP_OFFLINE_INACCESSIBLE) + mhp_altmap.inaccessible = true; params.altmap = kmalloc(sizeof(struct vmem_altmap), GFP_KERNEL); if (!params.altmap) { ret = -ENOMEM; diff --git a/mm/sparse.c b/mm/sparse.c index 77d91e565045..3991c717b769 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -907,7 +907,8 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, * Poison uninitialized struct pages in order to catch invalid flags * combinations. */ - page_init_poison(memmap, sizeof(struct page) * nr_pages); + if (!altmap || !altmap->inaccessible) + page_init_poison(memmap, sizeof(struct page) * nr_pages); ms = __nr_to_section(section_nr); set_section_nid(section_nr, nid); From patchwork Mon Nov 27 08:20:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumanth Korikkar X-Patchwork-Id: 13469259 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 34156C4167B for ; Mon, 27 Nov 2023 08:20:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34AEE6B0314; Mon, 27 Nov 2023 03:20:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FACC6B0316; Mon, 27 Nov 2023 03:20:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 100266B0318; Mon, 27 Nov 2023 03:20:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id ED6AE6B0314 for ; Mon, 27 Nov 2023 03:20:36 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C16ACB5259 for ; Mon, 27 Nov 2023 08:20:36 +0000 (UTC) X-FDA: 81503037672.22.2071298 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf03.hostedemail.com (Postfix) with ESMTP id 8E4CA20022 for ; Mon, 27 Nov 2023 08:20:34 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=D5zhwATM; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf03.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701073234; a=rsa-sha256; cv=none; b=nnZGA9nRQs/ieZZ3dmfo/hkldpD87+LHqxcrNQYIjAwZmOe562l71OMmMaphuqN9m1/yzd aCcNz0DCJoIegBOzUxtwVZ0+5IpczvbOcvAR4epzyNshRHQhQ//8MMNP+Ic86te516SQAg 5pPiJJgITpu5ZhGVqLN0vR8ZNF7JlUU= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=D5zhwATM; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf03.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 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=1701073234; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Dt1YW0vf+McTaKErPl0iHdB6D5PuLO6sey3WZMfMbwU=; b=qmI5ISPJncTeVVAs89GVmD+icLOtcmY/1OaspBALN8mqNphkto/XX5rPiaSrz44etO+WkH e5hrwyjcX6/GoOSi6ySD4v4YnLvARxXINzEe1MxvZ5asHh+k8GYZiNij1ptoYevp81EbXL WZNruVylCuf0J0mmodHDeQXXG4h7Brs= Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AR6eVf8012378; Mon, 27 Nov 2023 08:20:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Dt1YW0vf+McTaKErPl0iHdB6D5PuLO6sey3WZMfMbwU=; b=D5zhwATM5FQk8ExwcFcZauvIjWPmW6+nd+ysSkGlHlmnsa0V0mChFAHsi7LefOP/rrvw GRbbzdFt5iND2vEAWRygKrtG4SGrYIEACy5bAMGQv3dkd4y5dXAUAQdu4ofOV2OGhhXe X+mD5ziXjgsQL7H3zBycp6N0m1B0hBxHvmLmLpY+S1N/SO0sbIS63Z7suXTcs+d+TeHw zD7KMu34FczFmw72u5vdeCRMUf4Kaqft13XQRPdOk4YMEa4oO0QP5Ccmfz95k8FNnP88 pyxSWFYp8UuVc1FEm776hZ2l5pMh06L1Ir+bC2oHL8/Z3dBzsGsVLB9tkvqpQ32UF36+ OQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3umgdm92pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:31 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AR7eNM7024018; Mon, 27 Nov 2023 08:20:30 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3umgdm92pf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:30 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AR8JEqq031057; Mon, 27 Nov 2023 08:20:29 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ukvrk74uj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:29 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AR8KQ9a15401636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2023 08:20:26 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E29720040; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E4C52004D; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) From: Sumanth Korikkar To: linux-mm , Andrew Morton , David Hildenbrand Cc: Oscar Salvador , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , Gerald Schaefer , Sumanth Korikkar , Alexander Gordeev , Heiko Carstens , Vasily Gorbik , linux-s390 , LKML Subject: [PATCH v3 2/5] s390/mm: allocate vmemmap pages from self-contained memory range Date: Mon, 27 Nov 2023 09:20:20 +0100 Message-Id: <20231127082023.2079810-3-sumanthk@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231127082023.2079810-1-sumanthk@linux.ibm.com> References: <20231127082023.2079810-1-sumanthk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: KtxFm25MBaTYDqNKZZk3HQ4ChmJLvFIz X-Proofpoint-ORIG-GUID: pv7W0zo1agcow3G2CxMLeCUdjw03EyQ0 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-27_06,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=937 impostorscore=0 phishscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311270057 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8E4CA20022 X-Stat-Signature: co4pu3xezqn8awe6g7pr637s7t4xb5j1 X-HE-Tag: 1701073234-217109 X-HE-Meta: U2FsdGVkX1/Nv7Zjy73JnOz3B6QaodKBjx1c9xLixhQNORYEJFvpOpBRChjkdg+dIf3B9o7yj6TbZOEDmETW2uGnO30k/DjhvYTu/Dh8RROTkp5yK9TI3IHC3KeT7HjMooZkJDpjRL0rWJZzBActj9264jc6oNpENKCiOz4cP8ZHcNE/qZ3KvXq5YYha0glP7KBzGLNCKaE2X9eQWiaV3n5c5Poly359n9X7z+haQX2/u5xhHU9rd6NDt+qE+8TfOe0FGGJ4suaQOymiT1wMiGtqwsaG8neJlWk/nqeEZaKjEXNveD2Jwen0NFnz6NDbV51mneJIwo2uWgQj0b1h5fkIgahMrzXrg2qca9OQ1cysEHoFQVI2pO0h7qSPq2Hf0NjTIuYDSAEg82D2RzLg02zL5kq4E0kTv6AxznZdaBhYeNTSaCEpqRrYa4ZhVPaRkEBIKe//dZdp/jvBiIVOWAoRrU82cw1JSOzYgNt+HnHoPtdgEBkRfQ6VbtZwTPznvIPBlw8E1ElFmCwTK6aamNbz50NM6UPNchQ+AVxq64DXX4H6QhR53P3DoqqxxGgnE5FH3b+czznlszucwbBkNv7k8BDQ6zUpBy51gz5HE91YgGxv0JFW9EM4xyfdzWXiT34odAbXShBlS1s2u1bfoahU/qsgamvtfhbK7mBvKKl348YhO8jLMMv53iYdm+m+hin+4vxv/PnPhBYFO/SWznEEx+rtoheJUM+SzOPl86yelCSxdKJcUVzKQBlU8rD7D8P7Lrz5NxpMiAjOXPhihn/Lo2jKriynZsJcmAJ8Q7w1Al2vwpeMEkEsf59kkdAZfoWqS6GDLLPT3+TPcIf7nu/YlcysevL5yY8yHVXzTbBb1obCR5m4zZWSMrEMC9L5VcjT+9AKxIrqRkxfEPsm6JVEbGMP8WgJunUeexLdOgkzcOCMw/0W0uj0GxVE2VNIgnvwFypyNd1BjoIQejZ S7Nmnbwt oqqD3uP8xi5jB2qxl7IKlU0nu++Mp06Z7XbJiUVqCg4/ZM/lJ7NmtEheWt1GQ27L4pb7Z0wCK8f6PTLQwjba3TzIEd6jsCgmZoClNyWhPk5sStALnYlsjRq0rbY1vKCK8Et2F2GyYXyrep70= 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: Allocate memory map (struct pages array) from the hotplugged memory range, rather than using system memory. The change addresses the issue where standby memory, when configured to be much larger than online memory, could potentially lead to ipl failure due to memory map allocation from online memory. For example, 16MB of memory map allocation is needed for a memory block size of 1GB and when standby memory is configured much larger than online memory, this could lead to ipl failure. To address this issue, the solution involves introducing "memmap on memory" using the vmem_altmap structure on s390. Architectures that want to implement it should pass the altmap to the vmemmap_populate() function and its associated callchain. This enhancement is discussed in the commit 4b94ffdc4163 ("x86, mm: introduce vmem_altmap to augment vmemmap_populate()"). Provide "memmap on memory" support for s390 by passing the altmap in vmemmap_populate() and its callchain. The allocation path is described as follows: * When altmap is NULL in vmemmap_populate(), memory map allocation occurs using the existing vmemmap_alloc_block_buf(). * When altmap is not NULL in vmemmap_populate(), memory map allocation still uses vmemmap_alloc_block_buf(), but this function internally calls altmap_alloc_block_buf(). For deallocation, the process is outlined as follows: * When altmap is NULL in vmemmap_free(), memory map deallocation happens through free_pages(). * When altmap is not NULL in vmemmap_free(), memory map deallocation occurs via vmem_altmap_free(). While memory map allocation is primarily handled through the self-contained memory map range, there might still be a small amount of system memory allocation required for vmemmap pagetables. To mitigate this impact, this feature will be limited to machines with EDAT1 support. Reviewed-by: Gerald Schaefer Signed-off-by: Sumanth Korikkar --- arch/s390/mm/init.c | 3 --- arch/s390/mm/vmem.c | 62 +++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 43e612bc2bcd..8d9a60ccb777 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -281,9 +281,6 @@ int arch_add_memory(int nid, u64 start, u64 size, unsigned long size_pages = PFN_DOWN(size); int rc; - if (WARN_ON_ONCE(params->altmap)) - return -EINVAL; - if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot)) return -EINVAL; diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 186a020857cf..eb100479f7be 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -33,8 +33,12 @@ static void __ref *vmem_alloc_pages(unsigned int order) return memblock_alloc(size, size); } -static void vmem_free_pages(unsigned long addr, int order) +static void vmem_free_pages(unsigned long addr, int order, struct vmem_altmap *altmap) { + if (altmap) { + vmem_altmap_free(altmap, 1 << order); + return; + } /* We don't expect boot memory to be removed ever. */ if (!slab_is_available() || WARN_ON_ONCE(PageReserved(virt_to_page((void *)addr)))) @@ -156,7 +160,8 @@ static bool vmemmap_unuse_sub_pmd(unsigned long start, unsigned long end) /* __ref: we'll only call vmemmap_alloc_block() via vmemmap_populate() */ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr, - unsigned long end, bool add, bool direct) + unsigned long end, bool add, bool direct, + struct vmem_altmap *altmap) { unsigned long prot, pages = 0; int ret = -ENOMEM; @@ -172,11 +177,11 @@ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr, if (pte_none(*pte)) continue; if (!direct) - vmem_free_pages((unsigned long) pfn_to_virt(pte_pfn(*pte)), 0); + vmem_free_pages((unsigned long)pfn_to_virt(pte_pfn(*pte)), get_order(PAGE_SIZE), altmap); pte_clear(&init_mm, addr, pte); } else if (pte_none(*pte)) { if (!direct) { - void *new_page = vmemmap_alloc_block(PAGE_SIZE, NUMA_NO_NODE); + void *new_page = vmemmap_alloc_block_buf(PAGE_SIZE, NUMA_NO_NODE, altmap); if (!new_page) goto out; @@ -213,7 +218,8 @@ static void try_free_pte_table(pmd_t *pmd, unsigned long start) /* __ref: we'll only call vmemmap_alloc_block() via vmemmap_populate() */ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr, - unsigned long end, bool add, bool direct) + unsigned long end, bool add, bool direct, + struct vmem_altmap *altmap) { unsigned long next, prot, pages = 0; int ret = -ENOMEM; @@ -234,11 +240,11 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr, if (IS_ALIGNED(addr, PMD_SIZE) && IS_ALIGNED(next, PMD_SIZE)) { if (!direct) - vmem_free_pages(pmd_deref(*pmd), get_order(PMD_SIZE)); + vmem_free_pages(pmd_deref(*pmd), get_order(PMD_SIZE), altmap); pmd_clear(pmd); pages++; } else if (!direct && vmemmap_unuse_sub_pmd(addr, next)) { - vmem_free_pages(pmd_deref(*pmd), get_order(PMD_SIZE)); + vmem_free_pages(pmd_deref(*pmd), get_order(PMD_SIZE), altmap); pmd_clear(pmd); } continue; @@ -261,7 +267,7 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr, * page tables since vmemmap_populate gets * called for each section separately. */ - new_page = vmemmap_alloc_block(PMD_SIZE, NUMA_NO_NODE); + new_page = vmemmap_alloc_block_buf(PMD_SIZE, NUMA_NO_NODE, altmap); if (new_page) { set_pmd(pmd, __pmd(__pa(new_page) | prot)); if (!IS_ALIGNED(addr, PMD_SIZE) || @@ -280,7 +286,7 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr, vmemmap_use_sub_pmd(addr, next); continue; } - ret = modify_pte_table(pmd, addr, next, add, direct); + ret = modify_pte_table(pmd, addr, next, add, direct, altmap); if (ret) goto out; if (!add) @@ -302,12 +308,12 @@ static void try_free_pmd_table(pud_t *pud, unsigned long start) for (i = 0; i < PTRS_PER_PMD; i++, pmd++) if (!pmd_none(*pmd)) return; - vmem_free_pages(pud_deref(*pud), CRST_ALLOC_ORDER); + vmem_free_pages(pud_deref(*pud), CRST_ALLOC_ORDER, NULL); pud_clear(pud); } static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end, - bool add, bool direct) + bool add, bool direct, struct vmem_altmap *altmap) { unsigned long next, prot, pages = 0; int ret = -ENOMEM; @@ -347,7 +353,7 @@ static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end, } else if (pud_large(*pud)) { continue; } - ret = modify_pmd_table(pud, addr, next, add, direct); + ret = modify_pmd_table(pud, addr, next, add, direct, altmap); if (ret) goto out; if (!add) @@ -370,12 +376,12 @@ static void try_free_pud_table(p4d_t *p4d, unsigned long start) if (!pud_none(*pud)) return; } - vmem_free_pages(p4d_deref(*p4d), CRST_ALLOC_ORDER); + vmem_free_pages(p4d_deref(*p4d), CRST_ALLOC_ORDER, NULL); p4d_clear(p4d); } static int modify_p4d_table(pgd_t *pgd, unsigned long addr, unsigned long end, - bool add, bool direct) + bool add, bool direct, struct vmem_altmap *altmap) { unsigned long next; int ret = -ENOMEM; @@ -394,7 +400,7 @@ static int modify_p4d_table(pgd_t *pgd, unsigned long addr, unsigned long end, goto out; p4d_populate(&init_mm, p4d, pud); } - ret = modify_pud_table(p4d, addr, next, add, direct); + ret = modify_pud_table(p4d, addr, next, add, direct, altmap); if (ret) goto out; if (!add) @@ -415,12 +421,12 @@ static void try_free_p4d_table(pgd_t *pgd, unsigned long start) if (!p4d_none(*p4d)) return; } - vmem_free_pages(pgd_deref(*pgd), CRST_ALLOC_ORDER); + vmem_free_pages(pgd_deref(*pgd), CRST_ALLOC_ORDER, NULL); pgd_clear(pgd); } static int modify_pagetable(unsigned long start, unsigned long end, bool add, - bool direct) + bool direct, struct vmem_altmap *altmap) { unsigned long addr, next; int ret = -ENOMEM; @@ -445,7 +451,7 @@ static int modify_pagetable(unsigned long start, unsigned long end, bool add, goto out; pgd_populate(&init_mm, pgd, p4d); } - ret = modify_p4d_table(pgd, addr, next, add, direct); + ret = modify_p4d_table(pgd, addr, next, add, direct, altmap); if (ret) goto out; if (!add) @@ -458,14 +464,16 @@ static int modify_pagetable(unsigned long start, unsigned long end, bool add, return ret; } -static int add_pagetable(unsigned long start, unsigned long end, bool direct) +static int add_pagetable(unsigned long start, unsigned long end, bool direct, + struct vmem_altmap *altmap) { - return modify_pagetable(start, end, true, direct); + return modify_pagetable(start, end, true, direct, altmap); } -static int remove_pagetable(unsigned long start, unsigned long end, bool direct) +static int remove_pagetable(unsigned long start, unsigned long end, bool direct, + struct vmem_altmap *altmap) { - return modify_pagetable(start, end, false, direct); + return modify_pagetable(start, end, false, direct, altmap); } /* @@ -474,7 +482,7 @@ static int remove_pagetable(unsigned long start, unsigned long end, bool direct) static int vmem_add_range(unsigned long start, unsigned long size) { start = (unsigned long)__va(start); - return add_pagetable(start, start + size, true); + return add_pagetable(start, start + size, true, NULL); } /* @@ -483,7 +491,7 @@ static int vmem_add_range(unsigned long start, unsigned long size) static void vmem_remove_range(unsigned long start, unsigned long size) { start = (unsigned long)__va(start); - remove_pagetable(start, start + size, true); + remove_pagetable(start, start + size, true, NULL); } /* @@ -496,9 +504,9 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, mutex_lock(&vmem_mutex); /* We don't care about the node, just use NUMA_NO_NODE on allocations */ - ret = add_pagetable(start, end, false); + ret = add_pagetable(start, end, false, altmap); if (ret) - remove_pagetable(start, end, false); + remove_pagetable(start, end, false, altmap); mutex_unlock(&vmem_mutex); return ret; } @@ -509,7 +517,7 @@ void vmemmap_free(unsigned long start, unsigned long end, struct vmem_altmap *altmap) { mutex_lock(&vmem_mutex); - remove_pagetable(start, end, false); + remove_pagetable(start, end, false, altmap); mutex_unlock(&vmem_mutex); } From patchwork Mon Nov 27 08:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumanth Korikkar X-Patchwork-Id: 13469260 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 4BAFAC07D5A for ; Mon, 27 Nov 2023 08:20:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EBD66B0318; Mon, 27 Nov 2023 03:20:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 718B06B031A; Mon, 27 Nov 2023 03:20:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 592A46B031C; Mon, 27 Nov 2023 03:20:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 459D16B0318 for ; Mon, 27 Nov 2023 03:20:38 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 247BB1CAAF4 for ; Mon, 27 Nov 2023 08:20:38 +0000 (UTC) X-FDA: 81503037756.09.F6262D4 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf22.hostedemail.com (Postfix) with ESMTP id A2F17C001A for ; Mon, 27 Nov 2023 08:20:35 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=bEba76+w; spf=pass (imf22.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 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=1701073235; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VVtBHAgbLKbJwKCdTkswyGCbNkhwPlVjeKakadfoyQQ=; b=BvgsQ2+H53hG4u2Bfcov3XXxuolCwKV3xymclcPVCJIgmHxVn6dM6C3ivuJszEdUZsRADB gXDndtBH4xQWfBNe9z9+oPLAuEWxZju+spCxUqVaNWihucPnF/J6tHxMWYtdFe1K4MOlJy UxO6+xuRIuu0lwO0rf4iWLFpargNJbw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701073235; a=rsa-sha256; cv=none; b=U/cfKJKtm5z4W6T+hGISnIpuFDzrwr1BF++j4Ms3gIkYW0S/0MrPQ1tkwPa3GMHK+qfVic c1mXx4+0zl6vz6ioDtiutLFdRHKktl2py9d4Q+g7pZj5g2wYmhvwlII5OiUCoWz+jgwy0O JTNG4hFS361s+ovWM7Fgtg9ClTsFUeo= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=bEba76+w; spf=pass (imf22.hostedemail.com: domain of sumanthk@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=sumanthk@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AR6dFDh010309; Mon, 27 Nov 2023 08:20:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=VVtBHAgbLKbJwKCdTkswyGCbNkhwPlVjeKakadfoyQQ=; b=bEba76+wkHM8HXSWFmi2BaU8x+88bBaILVm8Aup3+DpGnp5dlvofkDIrP/w8jaMb0jdF JfX3zJ1w1CFI37iSaflhyy49ptMV7dGW3UFRYQTHrlADSSUxwVUGM2eNluwoCWeTHTyE TVtTT2XoObeYq5XuIl4aAAN0vM33E/wbbE+bVkrL2K+Whll/vTA+Txxq8Z8IRevvHYDQ 9LsHNp3HxQqFLzXygUuvbheityJee6PagHiTiKdqiI6DNGhtRA8iTk4sX+Q7NVc5pWst C3unX1ttbh3Ew5tfA2L883Npo2/dHAbrNmdVj0dharblDLt6YODCckbzrtkIYt/lJ+dD lA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3umjn5enkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:31 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AR6vwMc000756; Mon, 27 Nov 2023 08:20:30 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 3umjn5enk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:30 +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 3AR8JQhe024798; Mon, 27 Nov 2023 08:20:29 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ukwfjpwxf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 08:20:29 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AR8KRTR21299782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2023 08:20:27 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0912C20040; Mon, 27 Nov 2023 08:20:27 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 98BC720043; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Nov 2023 08:20:26 +0000 (GMT) From: Sumanth Korikkar To: linux-mm , Andrew Morton , David Hildenbrand Cc: Oscar Salvador , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , Gerald Schaefer , Sumanth Korikkar , Alexander Gordeev , Heiko Carstens , Vasily Gorbik , linux-s390 , LKML Subject: [PATCH v3 3/5] s390/sclp: remove unhandled memory notifier type Date: Mon, 27 Nov 2023 09:20:21 +0100 Message-Id: <20231127082023.2079810-4-sumanthk@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231127082023.2079810-1-sumanthk@linux.ibm.com> References: <20231127082023.2079810-1-sumanthk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5EEkk_6-SZhQagXPc5J04qBLLTBx-fkn X-Proofpoint-ORIG-GUID: VdcHQxy_svZgW537ilhlK5PSyE2yKod9 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-27_06,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=732 adultscore=0 clxscore=1015 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311270057 X-Rspamd-Queue-Id: A2F17C001A X-Rspam-User: X-Stat-Signature: 7oqqzcu13yt8h9d45gejohfiefocarja X-Rspamd-Server: rspam03 X-HE-Tag: 1701073235-577946 X-HE-Meta: U2FsdGVkX18g8TAzAuG5Hf1hV44F629FSIOu95iaGZYMnMdN4atd5kTalzEMKcrewxo6oYxcv52Q+xmSUY2dOTugEMMcUY8odw/M1elNEvzPtBODwN2hCq5vjMK0Hf3Uzp6cv61Va+Og97ffFuQN/Okj+gR37XmneRBbRT39SWllhEXbhpKpoyRLxh391tbQlxvR8BBawUTpF9sKCwumo1x5eOJu4c3uUeFMf4dQlr3pxlZUXUMxTw/eYx92udVrUCe9naULsoaANrWBwtMoBAXxyAEMTKV2WIJ+0vtOk3AFguGy4DBttoKc0gn0U692SHftHxQcG4EygPWF6eoIhhb/FjrBfYB/UMO4P2wbyiUb/wsm7EAyGAsUJaFcGu6hW2vQJyEFkZ9yZR7mgSgSP1dzeovsKI+fvLKXr4tGjN3zWbx82GvYpwVhMxXaF7fRa+eld0u5d/Hh84p1Ws66DFwDWJJvAKX7gCMtHpHd5tOYAah7ei18HUtQv3TnifPW0U6a+Pg3pTflbeDgpV+VoFjX+y7KyzJVkVFiviwXBht3EcXGlZCd1wj6h4WeUowrWjTKYmK5oJdVs3fMjQ8duxg17+Gs+1cx4SKv1kt0YnYgfCjCWVoA428X5Y2MGO9YYuUwSjvTB7Np/Z814vXfArtKmD7SoBqks+b6iCHCfdtlPM5Wx9B1axcY7kHWW21iHe75AsLwiNuxV2PHDJWiItwRUaTqD69s/LCT7OppdDmROxz7XEbgIplN9ZAiWEMLa74oWp5JW1fmqhCxr68Z2Y+4PH4ekTTeimiHF7/TAp66WRvYwyOVO8St8AuENjO8If1RbtXXiJcf1yVo0VU6lXG0w6VfaV38DzqSaoRSEpSFMWANX9S5nAYK37FviDyk7jtIrSdLdEuxRtQljdZiQ7DIuu4D0XK4Bo5ib3OTl3n9ZoZE8plTMzZSqHFNnbF5sJrw3NCaCK+NzQGlRi2 T97DNgK/ kddk6YirgRr2GhTg8gb01DdWe/Q7DZQ1xDtKrvl+nzk5iwSY+cc8sDlxzK4e+tt/r9UKb0da5+lmQD9KYKGgM6XfYfRxnZNnJeUT+pIt6T7g5EN1tS1K+NNpYv6irKgb6zEGpgwHKPVbDwwKM9s6km/lHfQ9VHxjakaWhEJ1iFISBphm3klxJ23BMwrSQhBbNdfgmgQWkvmMLxxMLn87FQuSK2dac9K1FX34kULjccdkuVF4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove memory notifier types which are unhandled by s390. Unhandled memory notifier types are covered by default case. Suggested-by: Alexander Gordeev Signed-off-by: Sumanth Korikkar Reviewed-by: David Hildenbrand --- drivers/s390/char/sclp_cmd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 11c428f4c7cf..355e63e44e95 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c @@ -340,9 +340,6 @@ static int sclp_mem_notifier(struct notifier_block *nb, if (contains_standby_increment(start, start + size)) rc = -EPERM; break; - case MEM_ONLINE: - case MEM_CANCEL_OFFLINE: - break; case MEM_GOING_ONLINE: rc = sclp_mem_change_state(start, size, 1); break;