All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Usama Arif <usamaarif642@gmail.com>
Cc: Kiryl Shutsemau <kirill@shutemov.name>,
	Andrew Morton <akpm@linux-foundation.org>,
	changyuanl@google.com, graf@amazon.com, leitao@debian.org,
	thevlad@meta.com, pratyush@kernel.org,
	dave.hansen@linux.intel.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH] mm/memblock: only mark/clear KHO scratch memory when needed
Date: Thu, 27 Nov 2025 07:05:04 +0200	[thread overview]
Message-ID: <aSfcAOiTzCba2LC0@kernel.org> (raw)
In-Reply-To: <fcf022e3-1d5e-4f66-9f95-49faefda04a6@gmail.com>

On Wed, Nov 26, 2025 at 11:43:21AM +0000, Usama Arif wrote:
> 
> On 26/11/2025 10:40, Kiryl Shutsemau wrote:
> > On Wed, Nov 26, 2025 at 07:20:51AM +0000, Usama Arif wrote:
> >> @@ -1126,8 +1126,11 @@ int __init_memblock memblock_reserved_mark_noinit(phys_addr_t base, phys_addr_t
> >>   */
> >>  __init int memblock_mark_kho_scratch(phys_addr_t base, phys_addr_t size)
> >>  {
> >> -	return memblock_setclr_flag(&memblock.memory, base, size, 1,
> >> -				    MEMBLOCK_KHO_SCRATCH);
> >> +	if (IS_ENABLED(CONFIG_MEMBLOCK_KHO_SCRATCH) && is_kho_boot())
> > 
> > It makes me wounder why CONFIG_MEMBLOCK_KHO_SCRATCH exists? It seems to
> > be a proxy for CONFIG_KEXEC_HANDOVER which is the only option that
> > selects it and does it always.
> > 
> > Can we make s/CONFIG_MEMBLOCK_KHO_SCRATCH/CONFIG_KEXEC_HANDOVER/ and
> > remove IS_ENABLED() from this check? Just is_kho_boot() is enough.
> > 
> > 
> 
> Thats a very good point! I imagine it might have been for maybe debug purposes?
> 
> Looking at the code, CONFIG_MEMBLOCK_KHO_SCRATCH shouldnt be needed. I guess
> this might be a good time to clean it up. If Mike is happy for it to be replaced
> with CONFIG_KEXEC_HANDOVER (and removed where needed), happy to send that
> for review instead of this.

Yeah, let's kill CONFIG_MEMBLOCK_KHO_SCRATCH and use CONFIG_KEXEC_HANDOVER
where needed.
IS_ENABLED() is not needed in the check because with
CONFIG_MEMBLOCK_KHO_SCRATCH=n both mark_kho_scratch() and
clear_kho_scratch() are empty stubs, so it's enough to check is_kho_boot().

> Thanks
> Usama

-- 
Sincerely yours,
Mike.


  reply	other threads:[~2025-11-27  5:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  7:20 [PATCH] mm/memblock: only mark/clear KHO scratch memory when needed Usama Arif
2025-11-26 10:40 ` Kiryl Shutsemau
2025-11-26 11:43   ` Usama Arif
2025-11-27  5:05     ` Mike Rapoport [this message]
2025-11-27  5:05 ` Mike Rapoport

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=aSfcAOiTzCba2LC0@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=changyuanl@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=graf@amazon.com \
    --cc=kernel-team@meta.com \
    --cc=kirill@shutemov.name \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pratyush@kernel.org \
    --cc=thevlad@meta.com \
    --cc=usamaarif642@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.