All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: "Michał Cłapiński" <mclapinski@google.com>
Cc: Evangelos Petrongonas <epetron@amazon.de>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Alexander Graf <graf@amazon.com>,
	Samiullah Khawaja <skhawaja@google.com>,
	kexec@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <jackmanb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>
Subject: Re: [PATCH v8 1/2] kho: fix deferred initialization of scratch areas
Date: Tue, 21 Apr 2026 09:08:27 +0300	[thread overview]
Message-ID: <aecUW-Xgm5MPMyVr@kernel.org> (raw)
In-Reply-To: <CAAi7L5cp3B0DFEQex5EqFdLDkqVWwRw228-pgp0PnhfgLP=e6Q@mail.gmail.com>

On Mon, Apr 20, 2026 at 03:11:03PM +0200, Michał Cłapiński wrote:
> On Thu, Apr 16, 2026 at 6:13 PM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > On Thu, Apr 16, 2026 at 05:06:10PM +0200, Michał Cłapiński wrote:
> > > On Thu, Apr 16, 2026 at 4:45 PM Mike Rapoport <rppt@kernel.org> wrote:
> > > >
> > > > Hi Michal,
> > > >
> > > > On Thu, Apr 16, 2026 at 01:06:53PM +0200, Michal Clapinski wrote:
> > > > > @@ -2262,6 +2253,12 @@ static void __init memmap_init_reserved_range(phys_addr_t start,
> > > > >                * access it yet.
> > > > >                */
> > > > >               __SetPageReserved(page);
> > > > > +
> > > > > +#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
> > > >
> > > > No need for #ifdef here, there's a stub returning false for
> > > > CONFIG_MEMBLOCK_KHO_SCRATCH=n case.
> > >
> > > In all 3 places the #ifdef is there because MIGRATE_CMA might be
> > > undefined. I already broke mm-new branch in the past because of that.
> >
> > Hmm, that hurts :/
> >
> > The best I can think of is to add a static inline in memblock.h and ifdefs
> > around it.
> 
> Sorry, I don't understand what you mean. What would that static inline contain?

Something like this:

#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
static inline enum migratetype kho_scratch_migratetype(unsigned long pfn,
						       enum migratetype mt)
{
	if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn)))
		return MIGRATE_CMA
	return mt;
}
#else
static inline enum migratetype kho_scratch_migratetype(unsigned long pfn,
						       enum migratetype mt)
{
	return mt;
}
#endif

Can't say I'm happy about the name, but could not think of something
better.

> > > > > +             if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn)) &&
> > > > > +                 pageblock_aligned(pfn))
> > > > > +                     init_pageblock_migratetype(page, MIGRATE_CMA, false);
> > > > > +#endif
> > > > >       }
> > > > >  }
> >
> > --
> > Sincerely yours,
> > Mike.

-- 
Sincerely yours,
Mike.


  reply	other threads:[~2026-04-21  6:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 11:06 [PATCH v8 0/2] kho: add support for deferred struct page init Michal Clapinski
2026-04-16 11:06 ` [PATCH v8 1/2] kho: fix deferred initialization of scratch areas Michal Clapinski
2026-04-16 14:45   ` Mike Rapoport
2026-04-16 15:06     ` Michał Cłapiński
2026-04-16 16:13       ` Mike Rapoport
2026-04-20 13:11         ` Michał Cłapiński
2026-04-21  6:08           ` Mike Rapoport [this message]
2026-04-21 10:20             ` Michał Cłapiński
2026-04-22  8:24               ` Mike Rapoport
2026-04-23  8:41                 ` Pratyush Yadav
2026-04-16 11:06 ` [PATCH v8 2/2] kho: make preserved pages compatible with deferred struct page init Michal Clapinski
2026-04-16 15:00 ` [PATCH v8 0/2] kho: add support for " Mike Rapoport
2026-04-16 15:23   ` Michał Cłapiński
2026-04-16 15:43     ` Mike Rapoport
2026-04-20  7:47     ` 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=aecUW-Xgm5MPMyVr@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=epetron@amazon.de \
    --cc=graf@amazon.com \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mclapinski@google.com \
    --cc=mhocko@suse.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=skhawaja@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=ziy@nvidia.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.