linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Bohac <jbohac@suse.cz>
To: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Hari Bathini <hbathini@linux.ibm.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Mahesh Salgaonkar <mahesh@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Shivang Upadhyay <shivangu@linux.ibm.com>
Subject: Re: [PATCH v2] powerpc/kdump: Add support for crashkernel CMA reservation
Date: Thu, 23 Oct 2025 17:23:32 +0200	[thread overview]
Message-ID: <aPpIdHMnSHRq8M6B@dwarf.suse.cz> (raw)
In-Reply-To: <20251023121413.56963-1-sourabhjain@linux.ibm.com>

On Thu, Oct 23, 2025 at 05:44:12PM +0530, Sourabh Jain wrote:
> @@ -595,6 +602,13 @@ int get_crash_memory_ranges(struct crash_mem **mem_ranges)
>  	if (ret)
>  		goto out;
>  
> +	for (i = 0; i < crashk_cma_cnt; ++i) {
> +		ret = crash_exclude_mem_range(tmem, crashk_cma_ranges[i].start,
> +					      crashk_cma_ranges[i].end);
> +		if (ret)
> +			goto out;
> +	}
> +

I think the loop needs to check if tmem->nr_ranges == tmem->max_nr_ranges and
reallocate in each iteration, just like it's done when excluding the crashk_res
region above:

        /* Reallocate memory ranges if there is no space to split ranges */
        tmem = *mem_ranges;
        if (tmem && (tmem->nr_ranges == tmem->max_nr_ranges)) {
                tmem = realloc_mem_ranges(mem_ranges);
                if (!tmem)
                        goto out;
        }

        /* Exclude crashkernel region */
        ret = crash_exclude_mem_range(tmem, crashk_res.start, crashk_res.end);
        if (ret)
                goto out;



-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, Prague, Czechia



  reply	other threads:[~2025-10-23 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 12:14 [PATCH v2] powerpc/kdump: Add support for crashkernel CMA reservation Sourabh Jain
2025-10-23 15:23 ` Jiri Bohac [this message]
2025-10-24  5:11   ` 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=aPpIdHMnSHRq8M6B@dwarf.suse.cz \
    --to=jbohac@suse.cz \
    --cc=hbathini@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=ritesh.list@gmail.com \
    --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).