[PATCH 09/12] memblock: introduce MEMBLOCK_KHO_SCRATCH_EXT

Mike Rapoport rppt at kernel.org
Mon May 11 05:06:19 PDT 2026


On Wed, Apr 29, 2026 at 03:39:11PM +0200, Pratyush Yadav wrote:
> From: "Pratyush Yadav (Google)" <pratyush at kernel.org>
> 
> In the upcoming commits, the KHO will learn how to discover free blocks
> of memory by walking the KHO radix tree. It will then mark those regions
> as scratch to allow memory allocation in case scratch runs low.
> 
> To differentiate the extended scratch areas from the main scratch areas,
> introduce MEMBLOCK_KHO_SCRATCH_EXT. Use it when choosing memblock flags
> for allocations during scratch-only. Teach should_skip_region() to check
> for both flags before deciding if the region should be skipped.

Why there's a need to differentiate SCRATCH and SCRATCH_EXT?
SCRATCH (I still hate the name) means "memory memblock can safely use for
the allocations". Initially this memory comes from the reservations in the
first kernel, but if the second kernel can find more memory to extend it,
why that additional memory should be treated differently? 

> Signed-off-by: Pratyush Yadav (Google) <pratyush at kernel.org>
> ---
> 
> Notes:
>     Checkpatch complains about no space after MEMBLOCK_KHO_SCRATCH_EXT in
>     the declaration, but doing so makes it nicely align with all the other
>     numbers. Mike, if you'd like I can add some whitespace.
> 
>  include/linux/memblock.h | 10 ++++++++++
>  mm/memblock.c            | 41 ++++++++++++++++++++++++++++++++++------
>  2 files changed, 45 insertions(+), 6 deletions(-)
 
-- 
Sincerely yours,
Mike.



More information about the kexec mailing list