[PATCH v2 14/18] memblock: use kho_scratch_overlap() to decide migratetype

Pratyush Yadav pratyush at kernel.org
Mon Jun 15 06:19:13 PDT 2026


On Sun, Jun 14 2026, Mike Rapoport wrote:

> On Fri, 05 Jun 2026 20:34:47 +0200, Pratyush Yadav <pratyush at kernel.org> wrote:
>> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
>> index 5afcd99aa8c1..546d7ef798b8 100644
>> --- a/include/linux/memblock.h
>> +++ b/include/linux/memblock.h
>> @@ -618,7 +619,7 @@ bool memblock_is_kho_scratch_memory(phys_addr_t addr);
>>  static inline enum migratetype kho_scratch_migratetype(unsigned long pfn,
>>  						       enum migratetype mt)
>>  {
>> -	if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn)))
>> +	if (kho_scratch_overlap(PFN_PHYS(pfn), pageblock_nr_pages << PAGE_SHIFT))
>
> I'd move it to kexec_handover.h and kill
> memblock_is_kho_scratch_memory() in the same patch
>
> BTW, please double check that the extended scratch does not require
> updates to efi_init()::reserve_regions().

It does not. efi_init() happens in setup_arch() on both x86 and arm64.
The extended scratch is discovered after setup_arch(), in
mm_core_init_early().

But I do think this is worth a comment since the interaction is not
obvious at all.

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list