linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Guo Weikang <guoweikang.kernel@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Guo Weikang <guoweikang.kernel@gmail.com>
Subject: [PATCH] arch/s390: save_area_alloc default failure behavior changed to panic
Date: Thu,  9 Jan 2025 11:31:36 +0800	[thread overview]
Message-ID: <20250109033136.2845676-1-guoweikang.kernel@gmail.com> (raw)

Now with the memblock_alloc_or_panic interface, save_area_alloc no longer
needs to handle panic itself.

Signed-off-by: Guo Weikang <guoweikang.kernel@gmail.com>
---
 arch/s390/kernel/crash_dump.c | 4 +---
 arch/s390/kernel/numa.c       | 3 +--
 arch/s390/kernel/smp.c        | 4 ----
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index f699df2a2b11..276cb4c1e11b 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -63,9 +63,7 @@ struct save_area * __init save_area_alloc(bool is_boot_cpu)
 {
 	struct save_area *sa;
 
-	sa = memblock_alloc(sizeof(*sa), 8);
-	if (!sa)
-		return NULL;
+	sa = memblock_alloc_or_panic(sizeof(*sa), 8);
 
 	if (is_boot_cpu)
 		list_add(&sa->list, &dump_save_areas);
diff --git a/arch/s390/kernel/numa.c b/arch/s390/kernel/numa.c
index a33e20f73330..2fc40f97c0ad 100644
--- a/arch/s390/kernel/numa.c
+++ b/arch/s390/kernel/numa.c
@@ -21,9 +21,8 @@ void __init numa_setup(void)
 	nodes_clear(node_possible_map);
 	node_set(0, node_possible_map);
 	node_set_online(0);
-	for (nid = 0; nid < MAX_NUMNODES; nid++) {
+	for (nid = 0; nid < MAX_NUMNODES; nid++)
 		NODE_DATA(nid) = memblock_alloc_or_panic(sizeof(pg_data_t), 8);
-	}
 	NODE_DATA(0)->node_spanned_pages = memblock_end_of_DRAM() >> PAGE_SHIFT;
 	NODE_DATA(0)->node_id = 0;
 }
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index d77aaefb59bd..7b08399b0846 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -611,8 +611,6 @@ void __init smp_save_dump_ipl_cpu(void)
 	if (!dump_available())
 		return;
 	sa = save_area_alloc(true);
-	if (!sa)
-		panic("could not allocate memory for boot CPU save area\n");
 	regs = memblock_alloc_or_panic(512, 8);
 	copy_oldmem_kernel(regs, __LC_FPREGS_SAVE_AREA, 512);
 	save_area_add_regs(sa, regs);
@@ -646,8 +644,6 @@ void __init smp_save_dump_secondary_cpus(void)
 		    SIGP_CC_NOT_OPERATIONAL)
 			continue;
 		sa = save_area_alloc(false);
-		if (!sa)
-			panic("could not allocate memory for save area\n");
 		__pcpu_sigp_relax(addr, SIGP_STORE_STATUS_AT_ADDRESS, __pa(page));
 		save_area_add_regs(sa, page);
 		if (cpu_has_vx()) {
-- 
2.25.1



             reply	other threads:[~2025-01-09  3:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09  3:31 Guo Weikang [this message]
2025-01-09  8:08 ` Alexander Gordeev
2025-01-09  8:28   ` Weikang Guo
2025-01-09 13:56     ` Alexander Gordeev
2025-01-09 14:53       ` Weikang Guo
2025-01-10  0:43         ` Andrew Morton
2025-01-10  6:48           ` Weikang Guo
2025-01-10  7:45           ` Alexander Gordeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250109033136.2845676-1-guoweikang.kernel@gmail.com \
    --to=guoweikang.kernel@gmail.com \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox