From nobody Thu Dec 18 00:06:32 2025 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B3C01B85EC for ; Fri, 31 Jan 2025 12:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738326351; cv=none; b=SP28ZRqPv7oCU4zIZgeoA+rj/M8BMmqDD4WanphhduGicogHXos8vc0WVG9pf2ymLvc7YqNdlgucGe3N76y2wzbSb5oFC3uLolvgfjrzpzJkKtAV7n5lE1aQ+fgvmp+ajHw6R5DYikBywhAT9iF4fgxaPqgymMjeWt85t/vuy2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738326351; c=relaxed/simple; bh=XMATi+BMPCBKLoLMjCaDJ1VGTmA00ZXYc7nIdEqIilI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZDdmSmg1Hlqugbe/xUmEXQ350LO1IIAd72M7deOWjxn0pZGnLDs0xaeeranaIqnQ+xVIA/7EUBIkHWANf8eHiBhExUUINk+RhbJsHgMphKZenAhg5BbAk3q51pkP5RZNuFmOOxjHscbbo4g8hmPBV49UQx8V/vaL/kKZbyTsiI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ICjSAuJN; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ICjSAuJN" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Content-Type: text/plain; charset="utf-8" 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; } =20 - /* Crash kernel trumps memory limit */ - if (memory_limit && memory_limit <=3D crashk_res.end) { - memory_limit =3D crashk_res.end + 1; - total_mem_sz =3D 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), --=20 2.48.1