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 F1006C433EF for ; Mon, 17 Jan 2022 07:53:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 478956B0071; Mon, 17 Jan 2022 02:53:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 428576B0073; Mon, 17 Jan 2022 02:53:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 317E16B0074; Mon, 17 Jan 2022 02:53:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 21ABC6B0071 for ; Mon, 17 Jan 2022 02:53:10 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C629B181DE57F for ; Mon, 17 Jan 2022 07:53:09 +0000 (UTC) X-FDA: 79039013298.07.BA7802B Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf22.hostedemail.com (Postfix) with ESMTP id D93A2C0005 for ; Mon, 17 Jan 2022 07:53:08 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20H7hDJ0023581; Mon, 17 Jan 2022 07:53:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=5i+MUfiKXp8lPljLcP3gk/e/t8wAAop3YvO3YFruja0=; b=BvzsETgrV+9tHJEyMUi9hjUaD2/tiyNKXWmlBupvhkvPi50JFgAFXV7fGWfG75lBkdHV sX85R4IE2f064WkTrTwFAJ0JsqdR+uc93awRHxuC7ai6E1FbWEbvesuDW3o0U/BMM5hz 2JmfJD1QWPm/Sqk1yWIJzk1qtq93+MApSux553lp0hR24lQpRxROu0FuEDpsjIrZziYA EO5/NFASywyHsi/Mc2oGZK8ga8s6HC0NDVaVNueePn4g2m9Mw3aHWVM5ww0g4QVPUOf4 RuRKDvfIB2ARec3XRjVIDqLpXvRK0y2aNm0e9zdPoF9WreaN8fwcT3NLw5ufOdu9PWv7 6A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn0jk4451-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:03 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20H7asUZ007404; Mon, 17 Jan 2022 07:53:02 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn0jk444f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:02 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20H7niWr002298; Mon, 17 Jan 2022 07:53:00 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 3dknw999v9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 07:53:00 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20H7qvrG36307318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 07:52:57 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F367A4055; Mon, 17 Jan 2022 07:52:57 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6E7EA4059; Mon, 17 Jan 2022 07:52:52 +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:52:52 +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 0/2] powerpc/fadump: handle CMA activation failure appropriately Date: Mon, 17 Jan 2022 13:22:44 +0530 Message-Id: <20220117075246.36072-1-hbathini@linux.ibm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AaFkl6K75zkADBvvs1KXXwu12OO51sBh X-Proofpoint-ORIG-GUID: GQQxQZMvz3tcPs-p0-8uiULOMcvHFX75 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 lowpriorityscore=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170048 X-Rspamd-Queue-Id: D93A2C0005 X-Stat-Signature: o6snarmqqa1nmcrxqkitcea88e6gedrk Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=BvzsETgr; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf22.hostedemail.com: domain of hbathini@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=hbathini@linux.ibm.com X-Rspamd-Server: rspam08 X-HE-Tag: 1642405988-979939 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: While commit a4e92ce8e4c8 ("powerpc/fadump: Reservationless firmware assisted dump"), introduced Linux kernel's Contiguous Memory Allocator (CMA) based reservation for fadump, it came with the assumption that the memory remains reserved even if CMA activation fails. It ensures no kernel pages reside in the reserved memory region, which can't be mapped into the /proc/vmcore. But commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") started returning all pages to buddy allocator if CMA activation fails. This 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: as reserved memory region ended up having kernel pages crash-utility was looking for. Fix this by introducing an option in CMA, to opt out from exposing pages to buddy allocator, on CMA activation failure. Changes in v3: * Dropped NULL check in cma_reserve_pages_on_error(). * Dropped explicit initialization of cma->reserve_pages_on_error to 'false' in cma_init_reserved_mem(). * Added review tags from David. Changes in v2: * Replaced cma->free_pages_on_error with cma->reserve_pages_on_error & cma_dont_free_pages_on_error() with cma_reserve_pages_on_error() to avoid confusion and make the expectation on failure clearer. Hari Bathini (2): mm/cma: provide option to opt out from exposing pages on activation failure powerpc/fadump: opt out from freeing pages on cma activation failure arch/powerpc/kernel/fadump.c | 6 ++++++ include/linux/cma.h | 2 ++ mm/cma.c | 11 +++++++++-- mm/cma.h | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) --=20 2.34.1