[PATCH v20 9/9] firmware: arm_rmm: hotplug: Skip memory added to ZONE_MOVABLE
Suzuki K Poulose
suzuki.poulose at arm.com
Wed Sep 30 05:47:45 PDT 2026
On 30/09/2026 13:22, David Hildenbrand (Arm) wrote:
> On 9/30/26 00:16, Suzuki K Poulose wrote:
>> If the hotadded memory is in ZONE_MOVABLE, we could allow that to proceed
>> without the RMM having fine grained tracking, as we won't allocate pages
>> from there for guest-memfd or kernel allocation
>>
>> Cc: Catalin Marinas <catalin.marinas at arm.com>
>> Cc: David Hildenbrand (Arm) <david at kernel.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose at arm.com>
>> ---
>> Changes since v19:
>> - New patch in v20, keeping this at the tail to allow for the rest of the
>> series to proceed, while this patch gets discussed.
>> ---
>> drivers/firmware/arm_rmm/rmi.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/firmware/arm_rmm/rmi.c b/drivers/firmware/arm_rmm/rmi.c
>> index d4d098448e46e..ef0a171ba9677 100644
>> --- a/drivers/firmware/arm_rmm/rmi.c
>> +++ b/drivers/firmware/arm_rmm/rmi.c
>> @@ -1043,6 +1043,18 @@ static int rmi_memory_notifier(struct notifier_block *nb,
>> start = PFN_PHYS(arg->start_pfn);
>> end = PFN_PHYS(arg->start_pfn + arg->nr_pages);
>>
>> + /*
>> + * If the hotplugged memory region is in ZONE_MOVABLE, neither the
>> + * guest-memfd nor the kernel allocations can come from there. So we are
>> + * fine to skip this.
>> + * For boot time memory, we don't allow this discount, as the
>> + * decision to move boot memory pages to ZONE_MOVABLE is purely
>> + * a kernel choice and the firmware must have decided what it covers.
>> + */
>> + if (page_zonenum(pfn_to_page(arg->start_pfn)) == ZONE_MOVABLE &&
>> + page_zonenum(pfn_to_page(arg->start_pfn + arg->nr_pages - 1)) == ZONE_MOVABLE)
>> + return NOTIFY_DONE;
>> +
>
> is_zone_movable_page(pfn_to_page(start_pfn)
>
> as used by virtio-mem should be sufficient. Checking only the start pfn is
> sufficient.
Thanks David, I will update it.
Cheers
Suzuki
>
More information about the linux-arm-kernel
mailing list