Re: [PATCH v3 3/7] mm/hotplug: Allow architecture to override memmap on memory support check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11.07.23 18:07, Aneesh Kumar K V wrote:
On 7/11/23 4:06 PM, David Hildenbrand wrote:
On 11.07.23 06:48, Aneesh Kumar K.V wrote:
Some architectures would want different restrictions. Hence add an
architecture-specific override.

Both the PMD_SIZE check and pageblock alignment check are moved there.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx>
---
   mm/memory_hotplug.c | 17 ++++++++++++-----
   1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 1b19462f4e72..07c99b0cc371 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1247,12 +1247,20 @@ static int online_memory_block(struct memory_block *mem, void *arg)
       return device_online(&mem->dev);
   }
   -static bool mhp_supports_memmap_on_memory(unsigned long size)
+#ifndef arch_supports_memmap_on_memory

Can we make that a __weak function instead?


We can. It is confusing because we do have these two patterns within the kernel where we use

#ifndef x
#endif

vs

__weak x

What is the recommended way to override ? I have mostly been using #ifndef for most of the arch overrides till now.


I think when placing the implementation in a C file, it's __weak. But don't ask me :)

We do this already for arch_get_mappable_range() in mm/memory_hotplug.c and IMHO it looks quite nice.


--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux