OSDN Git Service

mm/memory_hotplug: embed vmem_altmap details in memory block
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Tue, 8 Aug 2023 09:15:01 +0000 (14:45 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Aug 2023 20:37:49 +0000 (13:37 -0700)
commit1a8c64e110435e44e71bcd50a75663174b575f22
tree374c0671df09f80c8f19eb362d36916ca35dba88
parent603fd64dfa45d1e9df996911e4010f2b00731387
mm/memory_hotplug: embed vmem_altmap details in memory block

With memmap on memory, some architecture needs more details w.r.t altmap
such as base_pfn, end_pfn, etc to unmap vmemmap memory.  Instead of
computing them again when we remove a memory block, embed vmem_altmap
details in struct memory_block if we are using memmap on memory block
feature.

[yangyingliang@huawei.com: fix error return code in add_memory_resource()]
Link: https://lkml.kernel.org/r/20230809081552.1351184-1-yangyingliang@huawei.com
Link: https://lkml.kernel.org/r/20230808091501.287660-7-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.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>
drivers/base/memory.c
include/linux/memory.h
mm/memory_hotplug.c