From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: Baoquan he <bhe@redhat.com>, Jiri Bohac <jbohac@suse.cz>,
Hari Bathini <hbathini@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Mahesh Salgaonkar <mahesh@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Shivang Upadhyay <shivangu@linux.ibm.com>
Subject: Re: [PATCH v4] powerpc/kdump: Add support for crashkernel CMA reservation
Date: Fri, 31 Oct 2025 16:31:41 +0530 [thread overview]
Message-ID: <87ldkr72sq.ritesh.list@gmail.com> (raw)
In-Reply-To: <c6ce9b94-1126-49fd-869b-76a7e386a7d1@linux.ibm.com>
Sourabh Jain <sourabhjain@linux.ibm.com> writes:
> Hi Ritesh,
>
> On 31/10/25 09:27, Ritesh Harjani (IBM) wrote:
>> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>>
>>> Commit 35c18f2933c5 ("Add a new optional ",cma" suffix to the
>>> crashkernel= command line option") and commit ab475510e042 ("kdump:
>>> implement reserve_crashkernel_cma") added CMA support for kdump
>>> crashkernel reservation.
>>>
>>> Extend crashkernel CMA reservation support to powerpc.
>>>
>>> The following changes are made to enable CMA reservation on powerpc:
>>>
>>> - Parse and obtain the CMA reservation size along with other crashkernel
>>> parameters
>>> - Call reserve_crashkernel_cma() to allocate the CMA region for kdump
>>> - Include the CMA-reserved ranges in the usable memory ranges for the
>>> kdump kernel to use.
>>> - Exclude the CMA-reserved ranges from the crash kernel memory to
>>> prevent them from being exported through /proc/vmcore.
>>>
>>> With the introduction of the CMA crashkernel regions,
>>> crash_exclude_mem_range() needs to be called multiple times to exclude
>>> both crashk_res and crashk_cma_ranges from the crash memory ranges. To
>>> avoid repetitive logic for validating mem_ranges size and handling
>>> reallocation when required, this functionality is moved to a new wrapper
>>> function crash_exclude_mem_range_guarded().
>>>
>>> To ensure proper CMA reservation, reserve_crashkernel_cma() is called
>>> after pageblock_order is initialized.
>>>
>>> Cc: Baoquan he <bhe@redhat.com>
>>> Cc: Jiri Bohac <jbohac@suse.cz>
>>> Cc: Hari Bathini <hbathini@linux.ibm.com>
>>> Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
>>> Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>>> Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>>> ---
>>> Changlog:
>>>
>>> v3 -> v4
>>> - Removed repeated initialization to tmem in
>>> crash_exclude_mem_range_guarded()
>>> - Call crash_exclude_mem_range() with right crashk ranges
>>>
>>> ---
>>> arch/powerpc/include/asm/kexec.h | 2 ++
>>> arch/powerpc/kernel/setup-common.c | 4 ++-
>>> arch/powerpc/kexec/core.c | 10 ++++++-
>>> arch/powerpc/kexec/ranges.c | 43 ++++++++++++++++++++++--------
>>> 4 files changed, 46 insertions(+), 13 deletions(-)
>>
>> I am not much familiar with the crash kernel workings but was curious
>> about the following query related to this patch:
>>
>> As I understand this patch allows for the remaining crash kernel
>> memory to come from CMA region. But do we limit the CMA region to be lower
>> than 4G?
>
> No we are not and we don't need to.
>
>> Is this patch dependent over your other patch series [1] which
>> supports high crashkernel reservation?
>>
>> [1]: https://lore.kernel.org/linuxppc-dev/20251027151338.819957-1-sourabhjain@linux.ibm.com/
>
> No, this is an independent patch.
>
Say, if we are in Hash mode and if the CMA reservations have come from
higher addresses. Will that work with kdump kernel when it boots with Hash
mmu? Because memory region beyond RMA is not accessible in Hash correct?
-ritesh
>>
>>
>> A minor comment: I guess we could reflect the support for ,cma for PPC
>> too in Documentation/admin-guide/kernel-parameters.txt like how it is
>> done for x86.
>
> Yes we should. I will make the change in the next version.
>
> Thanks for the review.
>
> - Sourabh Jain
next prev parent reply other threads:[~2025-10-31 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 10:09 [PATCH v4] powerpc/kdump: Add support for crashkernel CMA reservation Sourabh Jain
2025-10-31 3:57 ` Ritesh Harjani
2025-10-31 6:06 ` Sourabh Jain
2025-10-31 11:01 ` Ritesh Harjani [this message]
2025-10-31 11:18 ` Ritesh Harjani
2025-11-03 4:06 ` Sourabh Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ldkr72sq.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=bhe@redhat.com \
--cc=hbathini@linux.ibm.com \
--cc=jbohac@suse.cz \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=shivangu@linux.ibm.com \
--cc=sourabhjain@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).