From patchwork Tue Mar 19 13:04:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Heimes X-Patchwork-Id: 1913558 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TzX4Y6bbhz1yWs for ; Wed, 20 Mar 2024 00:04:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rmZ8m-0003OI-0d; Tue, 19 Mar 2024 13:04:28 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rmZ8f-0003NM-24 for kernel-team@lists.ubuntu.com; Tue, 19 Mar 2024 13:04:21 +0000 Received: from T570.fritz.box (2.general.fheimes.us.vpn [10.172.66.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 48D3640EF7 for ; Tue, 19 Mar 2024 13:04:20 +0000 (UTC) From: frank.heimes@canonical.com To: kernel-team@lists.ubuntu.com Subject: [N][PATCH 0/6] Memory hotplug vmem pages (s390x) (LP: 2051835) Date: Tue, 19 Mar 2024 14:04:09 +0100 Message-Id: <20240319130415.495851-1-frank.heimes@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2051835 The current s390 specific memory hotplug backend allocates 'struct page' management structures for all standby memory regions, when those standby regions are detected at ipl time. The reason for this is, that setting standby online memory is supposed to succeed especially in memory constrained environments, since lack of free memory is likely the reason why additional memory is brought online. If in such cases 'struct pages' would have to be allocated before memory could be brought up, this would likely fail, and contradict the whole rationale of memory hotplug. However pre-allocating memory for 'struct pages' comes with the downside that for highly unbalanced ratios of online/standby memory a system might even fail to ipl, because there is not enough memory available for all possible struct pages which are required for standby memory. The idea is to improve the situation: when standby memory is brought online, the memory for struct pages (and maybe other management structures) required for this new memory area should be taken from the online memory, instead of pre-allocating them. This would solve the problems with unbalanced ratios as described above. Frank Heimes (1): UBUNTU: [Config] enable CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE and CONFIG_MHP_MEMMAP_ON_MEMORY for s390x Sumanth Korikkar (5): mm/memory_hotplug: introduce MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE notifiers s390/mm: allocate vmemmap pages from self-contained memory range s390/sclp: remove unhandled memory notifier type s390/mm: implement MEM_PREPARE_ONLINE/MEM_FINISH_OFFLINE notifiers s390: enable MHP_MEMMAP_ON_MEMORY arch/s390/Kconfig | 1 + arch/s390/mm/init.c | 3 -- arch/s390/mm/vmem.c | 62 ++++++++++++++++++-------------- debian.master/config/annotations | 8 +++-- drivers/base/memory.c | 23 +++++++++++- drivers/s390/char/sclp_cmd.c | 44 ++++++++++++++++++----- include/linux/memory.h | 9 +++++ include/linux/memory_hotplug.h | 18 +++++++++- include/linux/memremap.h | 1 + mm/memory_hotplug.c | 17 +++++++-- mm/sparse.c | 3 +- 11 files changed, 142 insertions(+), 47 deletions(-)