* [merged mm-stable] mm-memory_hotplug-allow-architecture-to-override-memmap-on-memory-support-check.patch removed from -mm tree
@ 2023-08-21 20:40 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-08-21 20:40 UTC (permalink / raw)
To: mm-commits, vishal.l.verma, osalvador, npiggin, mpe, mhocko,
david, christophe.leroy, aneesh.kumar, akpm
The quilt patch titled
Subject: mm/memory_hotplug: allow architecture to override memmap on memory support check
has been removed from the -mm tree. Its filename was
mm-memory_hotplug-allow-architecture-to-override-memmap-on-memory-support-check.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Subject: mm/memory_hotplug: allow architecture to override memmap on memory support check
Date: Tue, 8 Aug 2023 14:44:58 +0530
Some architectures would want different restrictions. Hence add an
architecture-specific override.
The PMD_SIZE check is moved there.
Link: https://lkml.kernel.org/r/20230808091501.287660-4-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory_hotplug.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
--- a/mm/memory_hotplug.c~mm-memory_hotplug-allow-architecture-to-override-memmap-on-memory-support-check
+++ a/mm/memory_hotplug.c
@@ -1247,10 +1247,26 @@ static int online_memory_block(struct me
return device_online(&mem->dev);
}
+static inline unsigned long memory_block_memmap_size(void)
+{
+ return PHYS_PFN(memory_block_size_bytes()) * sizeof(struct page);
+}
+
+#ifndef arch_supports_memmap_on_memory
+static inline bool arch_supports_memmap_on_memory(unsigned long vmemmap_size)
+{
+ /*
+ * As default, we want the vmemmap to span a complete PMD such that we
+ * can map the vmemmap using a single PMD if supported by the
+ * architecture.
+ */
+ return IS_ALIGNED(vmemmap_size, PMD_SIZE);
+}
+#endif
+
static bool mhp_supports_memmap_on_memory(unsigned long size)
{
- unsigned long nr_vmemmap_pages = size / PAGE_SIZE;
- unsigned long vmemmap_size = nr_vmemmap_pages * sizeof(struct page);
+ unsigned long vmemmap_size = memory_block_memmap_size();
unsigned long remaining_size = size - vmemmap_size;
/*
@@ -1281,8 +1297,8 @@ static bool mhp_supports_memmap_on_memor
*/
return mhp_memmap_on_memory() &&
size == memory_block_size_bytes() &&
- IS_ALIGNED(vmemmap_size, PMD_SIZE) &&
- IS_ALIGNED(remaining_size, (pageblock_nr_pages << PAGE_SHIFT));
+ IS_ALIGNED(remaining_size, (pageblock_nr_pages << PAGE_SHIFT)) &&
+ arch_supports_memmap_on_memory(vmemmap_size);
}
/*
_
Patches currently in -mm which might be from aneesh.kumar@linux.ibm.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-21 20:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 20:40 [merged mm-stable] mm-memory_hotplug-allow-architecture-to-override-memmap-on-memory-support-check.patch removed from -mm tree Andrew Morton
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.