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 54AC3FEE4EF for ; Sat, 28 Feb 2026 13:46:56 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fNRM23HlQz30Sv; Sun, 01 Mar 2026 00:46:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772286414; cv=none; b=GZ8NAJnbbC5GQxuNxklc0C7Kv/ms58xK8p5FpdzFZzNKYpkix7h1gGkDKxK+YGu3AV4Xih7RdMO8wQNx/HVY6oYbKe7+H4hiVLR6RLknkXEvVePzxHwWqdhIjTRasTOc0yzxWBcJkYAa+GE1Jxl2Ae4e4CPU2Nn8VgJm9A5/epXBskQ0Whw39Wstscy5rpu2k/nya0rOhWqOs2FZ7JM70Z3KxTtNfNDDJz8mc1Rq/LhM7nsP/YLF00SESovlyZJmWEdTuUptLQ9+fYheMQFBiwsL4Isy8YbSyMLC1tMTz+Fo5W2ZCFddFiGI4gtlVv+eP7QY9ffgQLtmDCyo6zOYLw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772286414; c=relaxed/relaxed; bh=0EXJKQ8KgtoZoI2jIZ7waJGT1vVb8Eepe+V8HPryizQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k8IlR6LbwmQe7xC7hQuP0W8wn68AodyXQnqAdrK1xy/vhGEHY/B6PVWwS+VdupOIn/JELTjARcdfiomPU3A5bO6/Avefg+K7QpmOEGmfadrX+Ciu9rh8wfH5Ku+O6kdZvbbjoou7Hq60njzSrv0PLpZtBtKFS/DaveLxaQAjrzvlwlORAfl2TaaXINcHsryj+efrKE2lV/Cy8aln/VJE7Mn4+Vl4o3iQiLDxiwXRPl6E/9T18b7/LB8x+wNJo/eJCmQAGYVVbg1nAhcOXcFvpSKumKfgWKqMHKnaW1cSLJU/vfj9fXTN3yCSZao+SXSeTeiXSFmoePjcBsco+UGWAg== 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=rgOOaLKc; dkim-atps=neutral; spf=pass (client-ip=148.163.158.5; helo=mx0b-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=rgOOaLKc; 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=sourabhjain@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fNRM06ChFz30BR for ; Sun, 01 Mar 2026 00:46:51 +1100 (AEDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61SDjoPq2612896; Sat, 28 Feb 2026 13:46:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=0EXJKQ 8KgtoZoI2jIZ7waJGT1vVb8Eepe+V8HPryizQ=; b=rgOOaLKcnwkp9J35cdBDUf lCHPdkUzz5Vyzwb3HzWiwUg0zsFc0WXpScsOfZ7uW38Aex6UC76IMQWpQerTwxW9 l8UrdT0EM4yrHSZAwdwN5mCWsqjpV1ePxBfqjrND6P1fu+GOsiwlybzpWv8QaJSc F4tUYexie9FTSeFKsvrQYj+wsTR/WmT1Nf3krpGnu7vXY8Kwba8NylOc1UcPgFMl 6U2G1cFI12w/pCHjRgXSSmtNwA0SSkOeDuBU2GUHxOdsRI9q0d+0/lZfjZNwIgB0 IjJ9xBcsEjTpie1HXiK+NoQ/e9cghsCr3NBysykbjMEQIi1LmB1KPH+y3sgSG7jw == Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4ckskbgxa7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 28 Feb 2026 13:46:31 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61SAjDH7004541; Sat, 28 Feb 2026 13:46:30 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4cfs8kej94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 28 Feb 2026 13:46:30 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61SDkQQo43319576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 28 Feb 2026 13:46:27 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E20B42004B; Sat, 28 Feb 2026 13:46:26 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 40FCC20043; Sat, 28 Feb 2026 13:46:24 +0000 (GMT) Received: from [9.124.209.149] (unknown [9.124.209.149]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Sat, 28 Feb 2026 13:46:23 +0000 (GMT) Message-ID: <6a0fc7ec-591e-4f23-b0f2-aec9aea88621@linux.ibm.com> Date: Sat, 28 Feb 2026 19:16:22 +0530 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: powerpc/fadump: CMA init is failing To: "Ritesh Harjani (IBM)" , Mike Rapoport Cc: Madhavan Srinivasan , linuxppc-dev , Michael Ellerman , Donet Tom , Hari Bathini , Mahesh J Salgaonkar , linux-mm@kvack.org References: <4c338a29-d190-44f3-8874-6cfa0a031f0b@linux.ibm.com> <87o6lagljy.ritesh.list@gmail.com> <87ms0th9xt.ritesh.list@gmail.com> Content-Language: en-US From: Sourabh Jain In-Reply-To: <87ms0th9xt.ritesh.list@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: 64-aI1JSamPa6-OAXTjSFOkfn4ujOU34 X-Authority-Analysis: v=2.4 cv=b66/I9Gx c=1 sm=1 tr=0 ts=69a2f1b7 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=47IChveiNnVNrxUg3wQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI4MDA1MCBTYWx0ZWRfX2DF1OSDfsUT/ ZYtsLcbSEit8DeUesUF/nKYn3Esq4ytJOBtNbtLetsiUYJOOD3PvBtv61FTuQmESBLnSyYYzrie l7AbG8/mR4YA4Yi8JEDELsWV/eFgFg7rqZWuZYzWtwKRFnNA6zy8OPFEWmBT81DqOvl6O6h/7aB OrvxFmwY6H5hsjsNubJaNfqc13lPHHUKAUp/6oE6BbYwLECUutRlHP7rcK5CcU4Fno2m4vraF7m N3TZ6CWLk1mVbfzYI9oQb85A7cSev4vfBocvaKRwr5b4pqehKi5XyWK9n1chVg1z5Ey+T9kruQS SPLoJfoIi0x7hGdtprWo1ksvVqs9M1OXMIFkn7EBR2HQFMCrptcj5XjRjtrHFWrpuTRV/LrGirw w1ehCXAW6hBITQLj0jhzdb67OPX4rI47EDoXFZV7yNVxF5UCMLaFwK/yJFaAdtOZzC/nt4m613q zrqrGk5po2cVcDYLZYA== X-Proofpoint-GUID: HnsQ0w4ztJoCl79kBZBod7RF8wisJzvH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-28_01,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602280050 Hello Ritesh, On 28/02/26 08:05, Ritesh Harjani (IBM) wrote: > Mike Rapoport writes: > >> Hi Ritesh, >> >> On Fri, Feb 27, 2026 at 10:39:53PM +0530, Ritesh Harjani wrote: >>> Sourabh Jain writes: >>> >>>> I noticed CMA init for fadump crashkernel memory is failing. >>>> >>>> [    0.000000] cma: pageblock_order not yet initialized. Called during >>>> early boot? >>>> [    0.000000] fadump: Failed to init cma area for firmware-assisted >>>> dump,-22 >>>> >>>> >>>> kernel command-line: >>>> BOOT_IMAGE=(ieee1275//vdevice/v-scsi@30000070/disk@8100000000000000,msdos2)/vmlinuz-7.0.0-rc1+ >>>> root=/dev/mapper/rhel_ltcden3--lp12-root ro >>>> rd.lvm.lv=rhel_ltcden3-lp12/root rd.lvm.lv=rhel_ltcden3-lp12/swap >>>> fadump=on crashkernel=3G >>>> >>>> >>>> Same issue with kdump CMA reservation: >>>> >>>> [    0.000000][    T0] cma: pageblock_order not yet initialized. Called >>>> during early boot? >>> Good that we added those debug prints ;) >>> >>> I think I know what went wrong, as part of this arch,mm consolidation >>> patch series [1], I think the order of initialization is changed. >>> >>> With this patch the new order is ... >>> start_kernel() >>> - setup_arch() >>> - xxx_cma_reserve(); >>> - mm_core_init_early() >>> - free_area_init() >>> - sparse_init() >>> - set_pageblock_order() // this sets the pageblock_order. >>> >>> Whereas earlier set_pageblock_order() was called from initmem_init(), >>> just before cma reservations were being made. >>> >>> start_kernel() >>> - setup_arch() >>> - initmem_init() >>> - sparse_init() >>> - set_pageblock_order(); // this sets the pageblock_order >>> - xxx_cma_reserve(); >>> >>> So that means, pageblock_order is not initialized before these cma >>> reservation function calls, hence we are seeing these failures. >>> >>> setup_arch() { >>> ... >>> >>> /* >>> * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM and >>> * hugetlb. These must be called after initmem_init(), so that >>> * pageblock_order is initialised. >>> */ >>> fadump_cma_init(); >>> kdump_cma_reserve(); >>> kvm_cma_reserve(); >>> >>> ... >>> } >>> >>> >>> So what if we do.. >>> >>> start_kernel() { >>> ... >>> setup_arch(&command_line); >>> mm_core_init_early(); >>> setup_arch_post_mm_core_init(); // and here we call CMA reservation functions ? >> >> Unless I'm missing something these cma reservations can be moved to >> arch_mm_preinit(). >> It runs after mm_core_init_early() and before memblock moves the free >> memory to the buddy. >> > Right. I think, we should be able to use that... > > @Sourabh, > > I don't have access to the systems (travelling back...). Could you > please give this a try? > > > diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c > index cb5b73adc250..b1761909c23f 100644 > --- a/arch/powerpc/kernel/setup-common.c > +++ b/arch/powerpc/kernel/setup-common.c > @@ -35,7 +35,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -995,15 +994,6 @@ void __init setup_arch(char **cmdline_p) > > initmem_init(); > > - /* > - * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM and > - * hugetlb. These must be called after initmem_init(), so that > - * pageblock_order is initialised. > - */ > - fadump_cma_init(); > - kdump_cma_reserve(); > - kvm_cma_reserve(); > - > early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT); > > if (ppc_md.setup_arch) > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index 29bf347f6012..5ba947e4fe37 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -30,6 +30,10 @@ > #include > #include > > +#include > +#include > +#include > + > #include > > unsigned long long memory_limit __initdata; > @@ -268,6 +272,16 @@ void __init paging_init(void) > > void __init arch_mm_preinit(void) > { > + > + /* > + * Reserve large chunks of memory for use by CMA for kdump, fadump, KVM > + * and hugetlb. These must be called after pageblock_order is > + * initialised. > + */ > + fadump_cma_init(); > + kdump_cma_reserve(); > + kvm_cma_reserve(); > + > /* > * book3s is limited to 16 page sizes due to encoding this in > * a 4-bit field for slices. The above changes fix the issue. CMA initialization now works for both kdump and fadump. Thanks for the fix. - Sourabh Jain