Patch "mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()" has been added to the 5.10-stable tree
Subsystems (3)
[email protected]
AppliedThis is a note to let you know that I've just added the patch titled
mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()
to the 5.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch
and it can be found in the queue-5.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <[email protected]>
Date: Tue, 7 Sep 2021 19:54:59 -0700
Subject: mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()
From: David Hildenbrand <[email protected]>
commit 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 upstream.
Patch series "mm/memory_hotplug: preparatory patches for new online policy and memory"
These are all cleanups and one fix previously sent as part of [1]:
[PATCH v1 00/12] mm/memory_hotplug: "auto-movable" online policy and memory groups.
These patches make sense even without the other series, therefore I pulled them out to make the other series easier to digest.
[1] https://lkml.kernel.org/r/[email protected]
This patch (of 4):
Checkpatch complained on a follow-up patch that we are using "unsigned" here, which defaults to "unsigned int" and checkpatch is correct.
As we will search for a fitting zone using the wrong pfn, we might end up onlining memory to one of the special kernel zones, such as ZONE_DMA, which can end badly as the onlined memory does not satisfy properties of these zones.
Use "unsigned long" instead, just as we do in other places when handling PFNs. This can bite us once we have physical addresses in the range of multiple TB.
--- include/linux/memory_hotplug.h | 4 ++-- mm/memory_hotplug.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/memory_hotplug.h +2 -2
@@ -359,8 +359,8 @@ extern void sparse_remove_section(struct unsigned long map_offset, struct vmem_altmap *altmap);extern struct page *sparse_decode_mem_map (unsigned long coded_mem_map,unsigned long pnum); -extern struct zone *zone_for_pfn_range (int online_type,int nid,unsigned start_pfn, -unsigned long nr_pages); +extern struct zone *zone_for_pfn_range (int online_type,int nid, +unsigned long start_pfn,unsigned long nr_pages);#endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* __LINUX_MEMORY_HOTPLUG_H */
mm/memory_hotplug.c +2 -2
@@ -765,8 +765,8 @@ static inline struct zone *default_zone_return movable_node_enabled ? movable_zone : kernel_zone; } -struct zone *zone_for_pfn_range (int online_type,int nid,unsigned start_pfn, -unsigned long nr_pages) +struct zone *zone_for_pfn_range (int online_type,int nid, +unsigned long start_pfn,unsigned long nr_pages) {if (online_type ==MMOP_ONLINE_KERNEL )return default_kernel_zone_for_pfn (nid, start_pfn, nr_pages);
Patches currently in stable-queue which might be from [email protected] are
queue-5.10/x86-mm-fix-kern_addr_valid-to-cope-with-existing-but-not-present-entries.patch queue-5.10/x86-pat-pass-valid-address-to-sanitize_phys.patch queue-5.10/mm-memory_hotplug-use-unsigned-long-for-pfn-in-zone_for_pfn_range.patch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization