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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0199CC02195 for ; Fri, 31 Jan 2025 12:25:49 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Ykw8q50lCz30Vw; Fri, 31 Jan 2025 23:25:47 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738326347; cv=none; b=NGgnop0nJwp2Bb0xIc96+ZqhSc9mHJkmS58gBz2oiEIXxPxlmnC1tiD7dZM2GvMi6abpX6JwmWln3+UPahBCsqb488XrrJsDesAocn9dtSdXT9uQJJ/9awGtHDRc3lTWxlY/+Oc20I6ihZEiEcoHgTbKYVqbyxpO6brjyXCFnm8tF2PQa+0yFJahmbiEBhXXv2XskkoUudlIXS3x4q2YUBWRIHFhE+SEVZu1L0gnMVJXPt2K33o/aYyt9tP58qbpywYbYGryhgLf0r6eJ3th3rHCXzxLWQnC5hhA4fdVt2r7kImHnlYVbVg38VLCWUXuD4pSw5yp8gfurB/l1n4ymA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738326347; c=relaxed/relaxed; bh=jBDlLH2LZNzPNbkkI8AcAIBcX6XfUJPGxSOUXJXt/V8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fKmFNitoTHK6z+1yaEC3OQp7wbGrKyeYRZhnw+bFICg1/hSkK4AgWYPbVfBcczgW+iqBMlNc4FdtMXpZvFxhibvsqKuVteO3XT0QS/0d/rzAaMLjAYKw57RGlj8muF7QIocKpZOkPVebpkAg4bgfFSWw6PZc9WuD2+UVm2QVXxzAkCj2bKo2OBPkUhXqJCrxdxvD7jBPAMP/sRixCamMFXkY+8e01t42FnZjQ81F/YWXMsm6VWTduGZLHpMwJUr0UwMXH/gR9yuIGXTZAiknMLhc24/rOrVSKj9DV70uVxpJBJ8TPwvCDBkGQi8MSZrYwSz+L2keEMXX9gLaiD5KiQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ICjSAuJN; dkim-atps=neutral; spf=pass (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=sourabhjain@linux.ibm.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ICjSAuJN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=sourabhjain@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Ykw8p4b70z30Vl for ; Fri, 31 Jan 2025 23:25:46 +1100 (AEDT) Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50V2Q1ci017251; Fri, 31 Jan 2025 12:25:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=jBDlLH2LZNzPNbkkI 8AcAIBcX6XfUJPGxSOUXJXt/V8=; b=ICjSAuJNY0BVWmGKsHCMXYYedO3d8EQ65 E4Heeq0rKAqzFBBLmU9tYrxILYmXucqDAOY/u8fxafCJYGAl0AJzpmWhOtaNb4Wf zEFhPallD41gkvWw6MOztFRRp5l9a4c+8Rrs8KgtIz5YTZx9p3mhs3FQ1v7GAcoE lHq8fog+7bCN7SR9qrt5GxGnTJlqSi46Alj0ypFPRqVZmDLSz9e9YCfKaA8zCym9 jMalninliI5jTaiPARR3439gA7aKaNTq83X8cpObeCfwXXYrRgIGa3Of1aYXQnvW kuxRvnGtnQVkPrr4/83Aa4mm621nCMyEBKxhbQPHr1i+e+S0pZymA== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 44gfn4upvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Jan 2025 12:25:36 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 50V8RIYT016065; Fri, 31 Jan 2025 12:25:35 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 44gfaubg3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Jan 2025 12:25:35 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 50VCPVhH22086114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Jan 2025 12:25:31 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B583D20106; Fri, 31 Jan 2025 11:39:04 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7C18620104; Fri, 31 Jan 2025 11:39:01 +0000 (GMT) Received: from li-4f5ba44c-27d4-11b2-a85c-a08f5b49eada.ibm.com.com (unknown [9.43.16.21]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Jan 2025 11:39:01 +0000 (GMT) From: Sourabh Jain To: linuxppc-dev@lists.ozlabs.org Cc: Sourabh Jain , Andrew Morton , Baoquan he , Madhavan Srinivasan , Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Hari Bathini , Mahesh Salgaonkar Subject: [PATCH v3 5/7] powerpc/crash: preserve user-specified memory limit Date: Fri, 31 Jan 2025 17:08:28 +0530 Message-ID: <20250131113830.925179-6-sourabhjain@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250131113830.925179-1-sourabhjain@linux.ibm.com> References: <20250131113830.925179-1-sourabhjain@linux.ibm.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zIcQfU6K-k387vFosKZC_TETEcc9Lcb_ X-Proofpoint-ORIG-GUID: zIcQfU6K-k387vFosKZC_TETEcc9Lcb_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-31_04,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2501310091 Commit 59d58189f3d9 ("crash: fix crash memory reserve exceed system memory bug") fails crashkernel parsing if the crash size is found to be higher than system RAM, which makes the memory_limit adjustment code ineffective due to an early exit from reserve_crashkernel(). Regardless lets not violate the user-specified memory limit by adjusting it. Remove this adjustment to ensure all reservations stay within the limit. Commit f94f5ac07983 ("powerpc/fadump: Don't update the user-specified memory limit") did the same for fadump. Cc: Andrew Morton Cc: Baoquan he CC: Madhavan Srinivasan Cc: Michael Ellerman Cc: kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Sourabh Jain --- arch/powerpc/kexec/core.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/kexec/core.c b/arch/powerpc/kexec/core.c index b8333a49ea5d..4945b33322ae 100644 --- a/arch/powerpc/kexec/core.c +++ b/arch/powerpc/kexec/core.c @@ -150,14 +150,6 @@ void __init reserve_crashkernel(void) return; } - /* Crash kernel trumps memory limit */ - if (memory_limit && memory_limit <= crashk_res.end) { - memory_limit = crashk_res.end + 1; - total_mem_sz = memory_limit; - printk("Adjusted memory limit for crashkernel, now 0x%llx\n", - memory_limit); - } - printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " "for crashkernel (System RAM: %ldMB)\n", (unsigned long)(crash_size >> 20), -- 2.48.1