numa.c 746 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * NUMA support for s390
  4. *
  5. * Implement NUMA core code.
  6. *
  7. * Copyright IBM Corp. 2015
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/mmzone.h>
  11. #include <linux/cpumask.h>
  12. #include <linux/memblock.h>
  13. #include <linux/node.h>
  14. #include <asm/numa.h>
  15. void __init numa_setup(void)
  16. {
  17. int nid;
  18. nodes_clear(node_possible_map);
  19. node_set(0, node_possible_map);
  20. node_set_online(0);
  21. for (nid = 0; nid < MAX_NUMNODES; nid++) {
  22. NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
  23. if (!NODE_DATA(nid))
  24. panic("%s: Failed to allocate %zu bytes align=0x%x\n",
  25. __func__, sizeof(pg_data_t), 8);
  26. }
  27. NODE_DATA(0)->node_spanned_pages = memblock_end_of_DRAM() >> PAGE_SHIFT;
  28. NODE_DATA(0)->node_id = 0;
  29. }