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 41419C433F5 for ; Thu, 6 Jan 2022 12:02:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB5A76B0085; Thu, 6 Jan 2022 07:02:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A65796B0087; Thu, 6 Jan 2022 07:02:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 906806B0088; Thu, 6 Jan 2022 07:02:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 825246B0085 for ; Thu, 6 Jan 2022 07:02:17 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4723195AFD for ; Thu, 6 Jan 2022 12:02:17 +0000 (UTC) X-FDA: 78999724314.24.CFD686E Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf03.hostedemail.com (Postfix) with ESMTP id 2F2C120023 for ; Thu, 6 Jan 2022 12:02:14 +0000 (UTC) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2069odTh028396; Thu, 6 Jan 2022 12:02:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=5ZprtjbV/QR3QSKTYw0UtXUoMTyJoBPKWwbTKYOWUu8=; b=m5+KkZdnxevb+Lxg3xyUIYNEvVwOCwWjohH1oq6Yg4KEOwH2OMYFPuGVjq9a8bDDCalw xxrcCKhax5iwloCm0QQ3v6ReyhzyzQv7Z789AllmCZW3KPIRlOTiO+GkwcVzlFzlubrb UGopiLKQXUrS3iNibDm5usbUkdt8LjTEnPPd9DOxMDws5utq3psINlD/qSG2vFHcFbsq kzXeQI6FETNhuE05QMVYd3tfSseY2++66kIRwOsQkbHaXaZlEU4pFPHDVqWPLibnyWkm r448YIZSnDQInOz+wjZadrZyc+2zBuibJITzBEALjflt0E4Z1EAQwfVAs5wG13O2T11c oA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ddx5b2aeh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:10 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 206Bn0GZ003154; Thu, 6 Jan 2022 12:02:10 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ddx5b2adj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:09 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 206Bvaw3014416; Thu, 6 Jan 2022 12:02:07 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 3ddmsvmw8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:07 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 206C24Mq37749138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jan 2022 12:02:04 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E69EC5204E; Thu, 6 Jan 2022 12:02:03 +0000 (GMT) Received: from [9.163.12.49] (unknown [9.163.12.49]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9EC2B5205F; Thu, 6 Jan 2022 12:01:59 +0000 (GMT) Message-ID: Date: Thu, 6 Jan 2022 17:31:57 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure Content-Language: en-US To: David Hildenbrand , akpm@linux-foundation.org, linux-mm@kvack.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org Cc: mike.kravetz@oracle.com, mahesh@linux.ibm.com, sourabhjain@linux.ibm.com, osalvador@suse.de References: <20211220193419.104242-1-hbathini@linux.ibm.com> <20211220193419.104242-2-hbathini@linux.ibm.com> From: Hari Bathini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: GfFPFHyGHg9HO-LKoI_82MhLV_wyhyeY X-Proofpoint-GUID: ZMlp5uAk3kBJhlhqSv2hc3Dloifv4YRN Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-06_04,2022-01-06_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 clxscore=1011 mlxlogscore=999 malwarescore=0 spamscore=0 mlxscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2112160000 definitions=main-2201060086 X-Rspamd-Queue-Id: 2F2C120023 X-Stat-Signature: teipquz3z7wrjguea7hwnggyzorp4oor Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=m5+KkZdn; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf03.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: rspam11 X-HE-Tag: 1641470534-48189 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: On 22/12/21 12:18 am, David Hildenbrand wrote: > On 20.12.21 20:34, Hari Bathini wrote: >> Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if >> activation of an area fails") started exposing all pages to buddy >> allocator on CMA activation failure. But there can be CMA users that >> want to handle the reserved memory differently on CMA allocation >> failure. Provide an option to opt out from exposing pages to buddy >> for such cases. Hi David, Sorry, I could not get back on this sooner. I went out on vacation and missed this. . > > Can you elaborate why that is important and what the target user can > actually do with it? Previously, firmware-assisted dump [1] used to reserve memory that it needs for booting a capture kernel & offloading /proc/vmcore. This memory is reserved, basically blocked from being used by production kernel, to ensure kernel crash context is not lost on booting into a capture kernel from this memory chunk. But [2] started using CMA instead to let the memory be used at least in some cases as long as this memory is not going to have kernel pages. So, the intention in using CMA was to keep the memory unused if CMA activation fails and only let it be used for some purpose, if at all, if CMA activation succeeds. But [3] breaks that assumption reporting weird errors on vmcore captured with fadump, when CMA activation fails. To answer the question, fadump does not want the memory to be used for kernel pages, if CMA activation fails... [1] https://github.com/torvalds/linux/blob/master/Documentation/powerpc/firmware-assisted-dump.rst [2] https://github.com/torvalds/linux/commit/a4e92ce8e4c8 [3] https://github.com/torvalds/linux/commit/072355c1cf2d Thanks Hari 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 1DA8DC433F5 for ; Thu, 6 Jan 2022 12:03:06 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JV4k05xTvz3cJl for ; Thu, 6 Jan 2022 23:03:04 +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=m5+KkZdn; 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=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=m5+KkZdn; dkim-atps=neutral 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 4JV4j66XFPz2x9T for ; Thu, 6 Jan 2022 23:02:18 +1100 (AEDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2069odTh028396; Thu, 6 Jan 2022 12:02:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=5ZprtjbV/QR3QSKTYw0UtXUoMTyJoBPKWwbTKYOWUu8=; b=m5+KkZdnxevb+Lxg3xyUIYNEvVwOCwWjohH1oq6Yg4KEOwH2OMYFPuGVjq9a8bDDCalw xxrcCKhax5iwloCm0QQ3v6ReyhzyzQv7Z789AllmCZW3KPIRlOTiO+GkwcVzlFzlubrb UGopiLKQXUrS3iNibDm5usbUkdt8LjTEnPPd9DOxMDws5utq3psINlD/qSG2vFHcFbsq kzXeQI6FETNhuE05QMVYd3tfSseY2++66kIRwOsQkbHaXaZlEU4pFPHDVqWPLibnyWkm r448YIZSnDQInOz+wjZadrZyc+2zBuibJITzBEALjflt0E4Z1EAQwfVAs5wG13O2T11c oA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ddx5b2aeh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:10 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 206Bn0GZ003154; Thu, 6 Jan 2022 12:02:10 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ddx5b2adj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:09 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 206Bvaw3014416; Thu, 6 Jan 2022 12:02:07 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 3ddmsvmw8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jan 2022 12:02:07 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 206C24Mq37749138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jan 2022 12:02:04 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E69EC5204E; Thu, 6 Jan 2022 12:02:03 +0000 (GMT) Received: from [9.163.12.49] (unknown [9.163.12.49]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9EC2B5205F; Thu, 6 Jan 2022 12:01:59 +0000 (GMT) Message-ID: Date: Thu, 6 Jan 2022 17:31:57 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure Content-Language: en-US To: David Hildenbrand , akpm@linux-foundation.org, linux-mm@kvack.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org References: <20211220193419.104242-1-hbathini@linux.ibm.com> <20211220193419.104242-2-hbathini@linux.ibm.com> From: Hari Bathini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: GfFPFHyGHg9HO-LKoI_82MhLV_wyhyeY X-Proofpoint-GUID: ZMlp5uAk3kBJhlhqSv2hc3Dloifv4YRN Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-06_04,2022-01-06_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 clxscore=1011 mlxlogscore=999 malwarescore=0 spamscore=0 mlxscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2112160000 definitions=main-2201060086 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: osalvador@suse.de, mahesh@linux.ibm.com, sourabhjain@linux.ibm.com, mike.kravetz@oracle.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 22/12/21 12:18 am, David Hildenbrand wrote: > On 20.12.21 20:34, Hari Bathini wrote: >> Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if >> activation of an area fails") started exposing all pages to buddy >> allocator on CMA activation failure. But there can be CMA users that >> want to handle the reserved memory differently on CMA allocation >> failure. Provide an option to opt out from exposing pages to buddy >> for such cases. Hi David, Sorry, I could not get back on this sooner. I went out on vacation and missed this. . > > Can you elaborate why that is important and what the target user can > actually do with it? Previously, firmware-assisted dump [1] used to reserve memory that it needs for booting a capture kernel & offloading /proc/vmcore. This memory is reserved, basically blocked from being used by production kernel, to ensure kernel crash context is not lost on booting into a capture kernel from this memory chunk. But [2] started using CMA instead to let the memory be used at least in some cases as long as this memory is not going to have kernel pages. So, the intention in using CMA was to keep the memory unused if CMA activation fails and only let it be used for some purpose, if at all, if CMA activation succeeds. But [3] breaks that assumption reporting weird errors on vmcore captured with fadump, when CMA activation fails. To answer the question, fadump does not want the memory to be used for kernel pages, if CMA activation fails... [1] https://github.com/torvalds/linux/blob/master/Documentation/powerpc/firmware-assisted-dump.rst [2] https://github.com/torvalds/linux/commit/a4e92ce8e4c8 [3] https://github.com/torvalds/linux/commit/072355c1cf2d Thanks Hari