Merge tag 'timers-core-2023-09-04-v2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / arch / s390 / kernel / numa.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
3a368f74
PH
2/*
3 * NUMA support for s390
4 *
5 * Implement NUMA core code.
6 *
7 * Copyright IBM Corp. 2015
8 */
9
3a368f74
PH
10#include <linux/kernel.h>
11#include <linux/mmzone.h>
12#include <linux/cpumask.h>
3a368f74 13#include <linux/memblock.h>
3a368f74 14#include <linux/node.h>
3a368f74 15#include <asm/numa.h>
3a368f74 16
701dc81e 17struct pglist_data *node_data[MAX_NUMNODES];
3a368f74
PH
18EXPORT_SYMBOL(node_data);
19
701dc81e 20void __init numa_setup(void)
3a368f74 21{
701dc81e 22 int nid;
3a368f74 23
701dc81e
HC
24 nodes_clear(node_possible_map);
25 node_set(0, node_possible_map);
26 node_set_online(0);
8a7f97b9 27 for (nid = 0; nid < MAX_NUMNODES; nid++) {
c2938eeb 28 NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
8a7f97b9
MR
29 if (!NODE_DATA(nid))
30 panic("%s: Failed to allocate %zu bytes align=0x%x\n",
31 __func__, sizeof(pg_data_t), 8);
32 }
701dc81e
HC
33 NODE_DATA(0)->node_spanned_pages = memblock_end_of_DRAM() >> PAGE_SHIFT;
34 NODE_DATA(0)->node_id = 0;
3a368f74 35}