From patchwork Thu Jan 9 03:31:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weikang Guo X-Patchwork-Id: 13931934 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 BA938E77197 for ; Thu, 9 Jan 2025 03:32:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 182986B00AB; Wed, 8 Jan 2025 22:32:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1331D6B00AC; Wed, 8 Jan 2025 22:32:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3C6F6B00AD; Wed, 8 Jan 2025 22:32:07 -0500 (EST) 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 D60896B00AB for ; Wed, 8 Jan 2025 22:32:07 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6C245A0C17 for ; Thu, 9 Jan 2025 03:32:07 +0000 (UTC) X-FDA: 82986489894.09.399A973 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf07.hostedemail.com (Postfix) with ESMTP id 9A42B40002 for ; Thu, 9 Jan 2025 03:32:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QXNegsEs; spf=pass (imf07.hostedemail.com: domain of guoweikang.kernel@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=guoweikang.kernel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736393525; 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:references:dkim-signature; bh=lXLkHTQWgHzu9KjIvPLCv6JTi/EeuuALx+VRr/98s4I=; b=NuOLdpAwzB+FgIWd8QNm4Ny3M46zVCVqndeBkrpgEpRREVw6mIdposTgGzqjbkwy9kZKsb FewRBlcGNlzpuALC5gF0JhDAoD7H8/Jf1Oo6jb9/1Ba9QzSAcZv+RxqrM3q7oS8hcaILOG e4uTD4d9b+7EsvPoNnKPFMbSIz6tajU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=QXNegsEs; spf=pass (imf07.hostedemail.com: domain of guoweikang.kernel@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=guoweikang.kernel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736393525; a=rsa-sha256; cv=none; b=VbGLHn8WZJnrwgYeg3FGxS7a1o4dAVe/1Ki5o4GIo2TUz7GorX2Z7N7h2T3wVCR3GCXNHf YdLynMd6JarpszmCmA5JfSTvQc9lHhCEmpg8XbdaXsi3IIyGEOwLWqajn5bhSOhERqQd0H +d7bVe8YB+YjCr/V/Pk2abG79pW4bU8= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2165448243fso6892465ad.1 for ; Wed, 08 Jan 2025 19:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736393524; x=1736998324; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lXLkHTQWgHzu9KjIvPLCv6JTi/EeuuALx+VRr/98s4I=; b=QXNegsEsy2XYuchRRUsxztMywkluFGHSQlsP+Rj634myesPOdX1qMJLlIr9hQ4tFbS obUo7tIatbz1P0WyxS7hdgG69dOZKYcsfL+TOcSbieBy79+mJN1Rq5Z5U3Mb8Trv/Ced DyNXFKda7N8pCo1uneUllan+b9Dfl70B25xhvYK2RGSq3IrQo6gUHGxmRRI0YYhcqXi/ +uYnwzJ8Yy02HjeMdc6tBZ0v6GDolJUJE/zURzFz8dKPkSxubbQWxXtu/xnFlPowlqgx g/8oUVj+/wwXh+lmCjVf0T2UaFPdM0edJmPcpSJedhCkOdqHObNmF+Sr5eSDfKbzxGMx eymg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736393524; x=1736998324; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lXLkHTQWgHzu9KjIvPLCv6JTi/EeuuALx+VRr/98s4I=; b=tsC47mDGNRD7ADU0exSJq9lrhZrqP2GFnlQRt8cOnXYgRuoz4pKfiVENbsr22nTryJ 0R/BL8mcXqMFBIrcbp0fhTVDZZF3pduJEw8VP7gX6lv4yrMvVIWPvrWbwIssTN5x51Hu ObghDkhRKeS9uXudep1XZ3GtUMBGadt8/tqegRx/SPijrjVKc7NtPd9dWTSe1BG7Xb9Z Q37ih3J6+ae8qWUUv9vbYiSHcVrCBFIoImwXDM3kZOBcNx3RmDqqQKYAMNIOQYXcM/Hi 1VPlf3C1Wdl67bfXeOGTSHMH8do+8LiR9GExVVQYw/DrfHLpTuQPectcRMdEVWy0mjp4 V/Zw== X-Forwarded-Encrypted: i=1; AJvYcCV7Pg+9gFIsDsMvXqqr1AoHClF7QxafbBAKxnHEV8tKbxvAC/dhT6UAQFAdg0yCEQ27Qrw4cUlI1g==@kvack.org X-Gm-Message-State: AOJu0Yzvuj16Ewlt9YOS7AZGB7d8EU02Q9lJ5l/tGMKGXT7lYDW5friB 7zRmwrJ9FgbQk96g05j5lGJArE7einn9xV5dR5gcdC/QUwHVBSfj X-Gm-Gg: ASbGncvsw5ewGGs8AD7eYWNo5dfv8sq/D60tONdBwC7psCeXwuPFPHfthn4iuS6Aily 2WKSJss9oDo0BobozevCYoKpH2nvQtaumwkK2n3HRdPCY64V3HxlBgAViR74gRc6ZKrj8UpzQGb /M3i7DYsmu7gepVtUAbdREnHB0bly7lfzwENMrXZSxYh/Nuq0k4rp1D4NIJk7zggrpMafe5fPd9 j3UB2xJaLH3kisz+GygdEMheI0UOmXOA7fLMtSDv5jPSh3H80Li/s8ARiaHA4KUedsZxPlCAJzH G0p8 X-Google-Smtp-Source: AGHT+IFWx3SO4h+JbQQAuUZJ3jBGwoAgqUM5IB48w8KUPjOfaHOhIfnoe7lR09EQQVbX4ymVPd2ccg== X-Received: by 2002:a17:903:1c7:b0:216:2bd7:1c36 with SMTP id d9443c01a7336-21a83f48ccbmr72098135ad.1.1736393524236; Wed, 08 Jan 2025 19:32:04 -0800 (PST) Received: from localhost.localdomain ([36.110.106.149]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9f4f5esm334455625ad.178.2025.01.08.19.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 19:32:03 -0800 (PST) From: Guo Weikang To: Andrew Morton , Alexander Gordeev Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Guo Weikang Subject: [PATCH] arch/s390: save_area_alloc default failure behavior changed to panic Date: Thu, 9 Jan 2025 11:31:36 +0800 Message-Id: <20250109033136.2845676-1-guoweikang.kernel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: hd6xz78dk7m7m3hac6wu6shu8pyxzq7s X-Rspamd-Queue-Id: 9A42B40002 X-Rspam-User: X-HE-Tag: 1736393525-324157 X-HE-Meta: U2FsdGVkX1+7/hEMawWxnHOSb6AzG0xVQ8EmUxX3F3UHp/yZsaYiMtP/2BsUFYTZoYzFTK66pM/oOlM4K42ZuSer5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b8baw2VVnNP0/rOFn43q1NAgr8wiydV6mH6l3Jqe7T9WpqvaoMIIZ4z3bJyp6ucu84yVZUli+NggFMDTnzhVMaJySnx48e7SJc/Lj6zOOVi4zveEjs2sKcPWKBqmFJozwbjSzg+fnlYRDgy7PGWqs3EOX/xp9179swLfrWw53EZmK8tEkzDFsj+en7j7NEo2ZfMU7f5TNz38YjLki2VhWjwpWD2s79HgeLoYTEokMWJtoDy/aw63+cVDN3L42jgKNTCwAb79elqtao7IQJrlIci9YbwmpdXiYptYD+ZZlB1u2vb5+cPpgVxqOp0B+nNYQjtf8gmt/jz1p7ZI/AB4DHsM= 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: Now with the memblock_alloc_or_panic interface, save_area_alloc no longer needs to handle panic itself. Signed-off-by: Guo Weikang --- 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()) {