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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B2AC433EF for ; Mon, 17 Jan 2022 07:53:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8A5F6B0074; Mon, 17 Jan 2022 02:53:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E3A156B0075; Mon, 17 Jan 2022 02:53:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D04426B0078; Mon, 17 Jan 2022 02:53:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id C24886B0074 for ; Mon, 17 Jan 2022 02:53:18 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 730AC824C429 for ; Mon, 17 Jan 2022 07:53:18 +0000 (UTC) X-FDA: 79039013676.23.2C63A33 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf09.hostedemail.com (Postfix) with ESMTP id 07043140007 for ; Mon, 17 Jan 2022 07:53:17 +0000 (UTC) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20H64Mei027263; Mon, 17 Jan 2022 07:53:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=zNmX1gF0jBLeOiEY0ju1uQtyZ3N1PSulnCuQStyZniA=; b=X3j4UiAU4vH3Noper9RL6gXTWITogeawb0yUgHN+r9iQ5e8C4gv60Zh2ZCeCFzdrAt9L 0BPSzdSrVBPhuOex4TSih7Nt99yvrqONpXEPoEesXf5A3bc1eRW0HDPLr3TcwedtyrdY fRxJSY1V0kQdw4MnO0sBGZshjeew6UfWVA4smQxJ3RG43ASC10YktkQRc3224wo4pSu0 Ddl4x2oDF9fw90nvMyWxCJ8mdG2GXYgzE7fx9yIkjSe/AwPFYXTfrC3WKCXaz3yGyAm1 djIU4/0n3xXUIavMW/YRl+xwDcpTqOo/umtnqm2oLCegamgjaf5Dt18IM/paQ/HxE8O/ oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dmxthwhk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:14 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20H7gpHE013234; Mon, 17 Jan 2022 07:53:13 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dmxthwhjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:13 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20H7qNEx020307; Mon, 17 Jan 2022 07:53:11 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3dknw90kvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:11 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20H7r8aC41091414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 07:53:08 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 32D42A4055; Mon, 17 Jan 2022 07:53:08 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 91417A4051; Mon, 17 Jan 2022 07:53:03 +0000 (GMT) Received: from hbathini-workstation.ibm.com.com (unknown [9.163.1.44]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jan 2022 07:53:03 +0000 (GMT) From: Hari Bathini To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org Cc: osalvador@suse.de, mike.kravetz@oracle.com, mahesh@linux.ibm.com, sourabhjain@linux.ibm.com Subject: [PATCH v3 2/2] powerpc/fadump: opt out from freeing pages on cma activation failure Date: Mon, 17 Jan 2022 13:22:46 +0530 Message-Id: <20220117075246.36072-3-hbathini@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220117075246.36072-1-hbathini@linux.ibm.com> References: <20220117075246.36072-1-hbathini@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: o0HkRLJEbUl-aA4UB82pl3cnu0DKXEGc X-Proofpoint-ORIG-GUID: hDrnqErmdNkx69irsm-KH2tbzU2yIzpn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-17_02,2022-01-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170048 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=X3j4UiAU; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf09.hostedemail.com: domain of hbathini@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=hbathini@linux.ibm.com X-Stat-Signature: d6dgzxhz4r3w3puxtfophpdjepjmfy3y X-Rspamd-Queue-Id: 07043140007 X-Rspamd-Server: rspam12 X-HE-Tag: 1642405997-866147 Content-Transfer-Encoding: quoted-printable 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: With commit a4e92ce8e4c8 ("powerpc/fadump: Reservationless firmware assisted dump"), Linux kernel's Contiguous Memory Allocator (CMA) based reservation was introduced in fadump. That change was aimed at using CMA to let applications utilize the memory reserved for fadump while blocking it from being used for kernel pages. The assumption was, even if CMA activation fails for whatever reason, the memory still remains reserved to avoid it from being used for kernel pages. But commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") breaks this assumption as it started exposing all pages to buddy allocator on CMA activation failure. It led to warning messages like below while running crash-utility on vmcore of a kernel having above two commits: crash: seek error: kernel virtual address: To fix this problem, opt out from exposing pages to buddy allocator on CMA activation failure for fadump reserved memory. Signed-off-by: Hari Bathini Acked-by: David Hildenbrand --- Changes in v3: * Added Acked-by tag from David. arch/powerpc/kernel/fadump.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index d03e488cfe9c..d0ad86b67e66 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -112,6 +112,12 @@ static int __init fadump_cma_init(void) return 1; } =20 + /* + * If CMA activation fails, keep the pages reserved, instead of + * exposing them to buddy allocator. Same as 'fadump=3Dnocma' case. + */ + cma_reserve_pages_on_error(fadump_cma); + /* * So we now have successfully initialized cma area for fadump. */ --=20 2.34.1 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 9389AC433F5 for ; Mon, 17 Jan 2022 07:55:19 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Jckj16Y3Dz3cPd for ; Mon, 17 Jan 2022 18:55:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=X3j4UiAU; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=hbathini@linux.ibm.com; receiver=) 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=X3j4UiAU; dkim-atps=neutral Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 4Jckfn1MGnz2xtQ for ; Mon, 17 Jan 2022 18:53:20 +1100 (AEDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20H64Mei027263; Mon, 17 Jan 2022 07:53:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=zNmX1gF0jBLeOiEY0ju1uQtyZ3N1PSulnCuQStyZniA=; b=X3j4UiAU4vH3Noper9RL6gXTWITogeawb0yUgHN+r9iQ5e8C4gv60Zh2ZCeCFzdrAt9L 0BPSzdSrVBPhuOex4TSih7Nt99yvrqONpXEPoEesXf5A3bc1eRW0HDPLr3TcwedtyrdY fRxJSY1V0kQdw4MnO0sBGZshjeew6UfWVA4smQxJ3RG43ASC10YktkQRc3224wo4pSu0 Ddl4x2oDF9fw90nvMyWxCJ8mdG2GXYgzE7fx9yIkjSe/AwPFYXTfrC3WKCXaz3yGyAm1 djIU4/0n3xXUIavMW/YRl+xwDcpTqOo/umtnqm2oLCegamgjaf5Dt18IM/paQ/HxE8O/ oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dmxthwhk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:14 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20H7gpHE013234; Mon, 17 Jan 2022 07:53:13 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dmxthwhjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:13 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20H7qNEx020307; Mon, 17 Jan 2022 07:53:11 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3dknw90kvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:11 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20H7r8aC41091414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 07:53:08 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 32D42A4055; Mon, 17 Jan 2022 07:53:08 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 91417A4051; Mon, 17 Jan 2022 07:53:03 +0000 (GMT) Received: from hbathini-workstation.ibm.com.com (unknown [9.163.1.44]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jan 2022 07:53:03 +0000 (GMT) From: Hari Bathini To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 2/2] powerpc/fadump: opt out from freeing pages on cma activation failure Date: Mon, 17 Jan 2022 13:22:46 +0530 Message-Id: <20220117075246.36072-3-hbathini@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220117075246.36072-1-hbathini@linux.ibm.com> References: <20220117075246.36072-1-hbathini@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: o0HkRLJEbUl-aA4UB82pl3cnu0DKXEGc X-Proofpoint-ORIG-GUID: hDrnqErmdNkx69irsm-KH2tbzU2yIzpn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-17_02,2022-01-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170048 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mike.kravetz@oracle.com, mahesh@linux.ibm.com, sourabhjain@linux.ibm.com, osalvador@suse.de Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" With commit a4e92ce8e4c8 ("powerpc/fadump: Reservationless firmware assisted dump"), Linux kernel's Contiguous Memory Allocator (CMA) based reservation was introduced in fadump. That change was aimed at using CMA to let applications utilize the memory reserved for fadump while blocking it from being used for kernel pages. The assumption was, even if CMA activation fails for whatever reason, the memory still remains reserved to avoid it from being used for kernel pages. But commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") breaks this assumption as it started exposing all pages to buddy allocator on CMA activation failure. It led to warning messages like below while running crash-utility on vmcore of a kernel having above two commits: crash: seek error: kernel virtual address: To fix this problem, opt out from exposing pages to buddy allocator on CMA activation failure for fadump reserved memory. Signed-off-by: Hari Bathini Acked-by: David Hildenbrand --- Changes in v3: * Added Acked-by tag from David. arch/powerpc/kernel/fadump.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index d03e488cfe9c..d0ad86b67e66 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -112,6 +112,12 @@ static int __init fadump_cma_init(void) return 1; } + /* + * If CMA activation fails, keep the pages reserved, instead of + * exposing them to buddy allocator. Same as 'fadump=nocma' case. + */ + cma_reserve_pages_on_error(fadump_cma); + /* * So we now have successfully initialized cma area for fadump. */ -- 2.34.1