mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
2848a28b0a
... and call node_dev_init() after memory_dev_init() from driver_init(), so before any of the existing arch/subsys calls. All online nodes should be known at that point: early during boot, arch code determines node and zone ranges and sets the relevant nodes online; usually this happens in setup_arch(). This is in line with memory_dev_init(), which initializes the memory device subsystem and creates all memory block devices. Similar to memory_dev_init(), panic() if anything goes wrong, we don't want to continue with such basic initialization errors. The important part is that node_dev_init() gets called after memory_dev_init() and after cpu_dev_init(), but before any of the relevant archs call register_cpu() to register the new cpu device under the node device. The latter should be the case for the current users of topology_init(). Link: https://lkml.kernel.org/r/20220203105212.30385-1-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Oscar Salvador <osalvador@suse.de> Tested-by: Anatoly Pugachev <matorola@gmail.com> (sparc64) Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Mike Rapoport <rppt@kernel.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
36 lines
818 B
C
36 lines
818 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* NUMA support for s390
|
|
*
|
|
* Implement NUMA core code.
|
|
*
|
|
* Copyright IBM Corp. 2015
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/mmzone.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/memblock.h>
|
|
#include <linux/node.h>
|
|
#include <asm/numa.h>
|
|
|
|
struct pglist_data *node_data[MAX_NUMNODES];
|
|
EXPORT_SYMBOL(node_data);
|
|
|
|
void __init numa_setup(void)
|
|
{
|
|
int nid;
|
|
|
|
nodes_clear(node_possible_map);
|
|
node_set(0, node_possible_map);
|
|
node_set_online(0);
|
|
for (nid = 0; nid < MAX_NUMNODES; nid++) {
|
|
NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
|
|
if (!NODE_DATA(nid))
|
|
panic("%s: Failed to allocate %zu bytes align=0x%x\n",
|
|
__func__, sizeof(pg_data_t), 8);
|
|
}
|
|
NODE_DATA(0)->node_spanned_pages = memblock_end_of_DRAM() >> PAGE_SHIFT;
|
|
NODE_DATA(0)->node_id = 0;
|
|
}
|