discontig.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000, 2003 Silicon Graphics, Inc. All rights reserved.
  4. * Copyright (c) 2001 Intel Corp.
  5. * Copyright (c) 2001 Tony Luck <tony.luck@intel.com>
  6. * Copyright (c) 2002 NEC Corp.
  7. * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
  8. * Copyright (c) 2004 Silicon Graphics, Inc
  9. * Russ Anderson <rja@sgi.com>
  10. * Jesse Barnes <jbarnes@sgi.com>
  11. * Jack Steiner <steiner@sgi.com>
  12. */
  13. /*
  14. * Platform initialization for Discontig Memory
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/mm.h>
  18. #include <linux/nmi.h>
  19. #include <linux/swap.h>
  20. #include <linux/bootmem.h>
  21. #include <linux/memblock.h>
  22. #include <linux/acpi.h>
  23. #include <linux/efi.h>
  24. #include <linux/nodemask.h>
  25. #include <linux/slab.h>
  26. #include <asm/pgalloc.h>
  27. #include <asm/tlb.h>
  28. #include <asm/meminit.h>
  29. #include <asm/numa.h>
  30. #include <asm/sections.h>
  31. /*
  32. * Track per-node information needed to setup the boot memory allocator, the
  33. * per-node areas, and the real VM.
  34. */
  35. struct early_node_data {
  36. struct ia64_node_data *node_data;
  37. unsigned long pernode_addr;
  38. unsigned long pernode_size;
  39. unsigned long min_pfn;
  40. unsigned long max_pfn;
  41. };
  42. static struct early_node_data mem_data[MAX_NUMNODES] __initdata;
  43. static nodemask_t memory_less_mask __initdata;
  44. pg_data_t *pgdat_list[MAX_NUMNODES];
  45. /*
  46. * To prevent cache aliasing effects, align per-node structures so that they
  47. * start at addresses that are strided by node number.
  48. */
  49. #define MAX_NODE_ALIGN_OFFSET (32 * 1024 * 1024)
  50. #define NODEDATA_ALIGN(addr, node) \
  51. ((((addr) + 1024*1024-1) & ~(1024*1024-1)) + \
  52. (((node)*PERCPU_PAGE_SIZE) & (MAX_NODE_ALIGN_OFFSET - 1)))
  53. /**
  54. * build_node_maps - callback to setup mem_data structs for each node
  55. * @start: physical start of range
  56. * @len: length of range
  57. * @node: node where this range resides
  58. *
  59. * Detect extents of each piece of memory that we wish to
  60. * treat as a virtually contiguous block (i.e. each node). Each such block
  61. * must start on an %IA64_GRANULE_SIZE boundary, so we round the address down
  62. * if necessary. Any non-existent pages will simply be part of the virtual
  63. * memmap.
  64. */
  65. static int __init build_node_maps(unsigned long start, unsigned long len,
  66. int node)
  67. {
  68. unsigned long spfn, epfn, end = start + len;
  69. epfn = GRANULEROUNDUP(end) >> PAGE_SHIFT;
  70. spfn = GRANULEROUNDDOWN(start) >> PAGE_SHIFT;
  71. if (!mem_data[node].min_pfn) {
  72. mem_data[node].min_pfn = spfn;
  73. mem_data[node].max_pfn = epfn;
  74. } else {
  75. mem_data[node].min_pfn = min(spfn, mem_data[node].min_pfn);
  76. mem_data[node].max_pfn = max(epfn, mem_data[node].max_pfn);
  77. }
  78. return 0;
  79. }
  80. /**
  81. * early_nr_cpus_node - return number of cpus on a given node
  82. * @node: node to check
  83. *
  84. * Count the number of cpus on @node. We can't use nr_cpus_node() yet because
  85. * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been
  86. * called yet. Note that node 0 will also count all non-existent cpus.
  87. */
  88. static int __meminit early_nr_cpus_node(int node)
  89. {
  90. int cpu, n = 0;
  91. for_each_possible_early_cpu(cpu)
  92. if (node == node_cpuid[cpu].nid)
  93. n++;
  94. return n;
  95. }
  96. /**
  97. * compute_pernodesize - compute size of pernode data
  98. * @node: the node id.
  99. */
  100. static unsigned long __meminit compute_pernodesize(int node)
  101. {
  102. unsigned long pernodesize = 0, cpus;
  103. cpus = early_nr_cpus_node(node);
  104. pernodesize += PERCPU_PAGE_SIZE * cpus;
  105. pernodesize += node * L1_CACHE_BYTES;
  106. pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
  107. pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
  108. pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
  109. pernodesize = PAGE_ALIGN(pernodesize);
  110. return pernodesize;
  111. }
  112. /**
  113. * per_cpu_node_setup - setup per-cpu areas on each node
  114. * @cpu_data: per-cpu area on this node
  115. * @node: node to setup
  116. *
  117. * Copy the static per-cpu data into the region we just set aside and then
  118. * setup __per_cpu_offset for each CPU on this node. Return a pointer to
  119. * the end of the area.
  120. */
  121. static void *per_cpu_node_setup(void *cpu_data, int node)
  122. {
  123. #ifdef CONFIG_SMP
  124. int cpu;
  125. for_each_possible_early_cpu(cpu) {
  126. void *src = cpu == 0 ? __cpu0_per_cpu : __phys_per_cpu_start;
  127. if (node != node_cpuid[cpu].nid)
  128. continue;
  129. memcpy(__va(cpu_data), src, __per_cpu_end - __per_cpu_start);
  130. __per_cpu_offset[cpu] = (char *)__va(cpu_data) -
  131. __per_cpu_start;
  132. /*
  133. * percpu area for cpu0 is moved from the __init area
  134. * which is setup by head.S and used till this point.
  135. * Update ar.k3. This move is ensures that percpu
  136. * area for cpu0 is on the correct node and its
  137. * virtual address isn't insanely far from other
  138. * percpu areas which is important for congruent
  139. * percpu allocator.
  140. */
  141. if (cpu == 0)
  142. ia64_set_kr(IA64_KR_PER_CPU_DATA,
  143. (unsigned long)cpu_data -
  144. (unsigned long)__per_cpu_start);
  145. cpu_data += PERCPU_PAGE_SIZE;
  146. }
  147. #endif
  148. return cpu_data;
  149. }
  150. #ifdef CONFIG_SMP
  151. /**
  152. * setup_per_cpu_areas - setup percpu areas
  153. *
  154. * Arch code has already allocated and initialized percpu areas. All
  155. * this function has to do is to teach the determined layout to the
  156. * dynamic percpu allocator, which happens to be more complex than
  157. * creating whole new ones using helpers.
  158. */
  159. void __init setup_per_cpu_areas(void)
  160. {
  161. struct pcpu_alloc_info *ai;
  162. struct pcpu_group_info *uninitialized_var(gi);
  163. unsigned int *cpu_map;
  164. void *base;
  165. unsigned long base_offset;
  166. unsigned int cpu;
  167. ssize_t static_size, reserved_size, dyn_size;
  168. int node, prev_node, unit, nr_units, rc;
  169. ai = pcpu_alloc_alloc_info(MAX_NUMNODES, nr_cpu_ids);
  170. if (!ai)
  171. panic("failed to allocate pcpu_alloc_info");
  172. cpu_map = ai->groups[0].cpu_map;
  173. /* determine base */
  174. base = (void *)ULONG_MAX;
  175. for_each_possible_cpu(cpu)
  176. base = min(base,
  177. (void *)(__per_cpu_offset[cpu] + __per_cpu_start));
  178. base_offset = (void *)__per_cpu_start - base;
  179. /* build cpu_map, units are grouped by node */
  180. unit = 0;
  181. for_each_node(node)
  182. for_each_possible_cpu(cpu)
  183. if (node == node_cpuid[cpu].nid)
  184. cpu_map[unit++] = cpu;
  185. nr_units = unit;
  186. /* set basic parameters */
  187. static_size = __per_cpu_end - __per_cpu_start;
  188. reserved_size = PERCPU_MODULE_RESERVE;
  189. dyn_size = PERCPU_PAGE_SIZE - static_size - reserved_size;
  190. if (dyn_size < 0)
  191. panic("percpu area overflow static=%zd reserved=%zd\n",
  192. static_size, reserved_size);
  193. ai->static_size = static_size;
  194. ai->reserved_size = reserved_size;
  195. ai->dyn_size = dyn_size;
  196. ai->unit_size = PERCPU_PAGE_SIZE;
  197. ai->atom_size = PAGE_SIZE;
  198. ai->alloc_size = PERCPU_PAGE_SIZE;
  199. /*
  200. * CPUs are put into groups according to node. Walk cpu_map
  201. * and create new groups at node boundaries.
  202. */
  203. prev_node = -1;
  204. ai->nr_groups = 0;
  205. for (unit = 0; unit < nr_units; unit++) {
  206. cpu = cpu_map[unit];
  207. node = node_cpuid[cpu].nid;
  208. if (node == prev_node) {
  209. gi->nr_units++;
  210. continue;
  211. }
  212. prev_node = node;
  213. gi = &ai->groups[ai->nr_groups++];
  214. gi->nr_units = 1;
  215. gi->base_offset = __per_cpu_offset[cpu] + base_offset;
  216. gi->cpu_map = &cpu_map[unit];
  217. }
  218. rc = pcpu_setup_first_chunk(ai, base);
  219. if (rc)
  220. panic("failed to setup percpu area (err=%d)", rc);
  221. pcpu_free_alloc_info(ai);
  222. }
  223. #endif
  224. /**
  225. * fill_pernode - initialize pernode data.
  226. * @node: the node id.
  227. * @pernode: physical address of pernode data
  228. * @pernodesize: size of the pernode data
  229. */
  230. static void __init fill_pernode(int node, unsigned long pernode,
  231. unsigned long pernodesize)
  232. {
  233. void *cpu_data;
  234. int cpus = early_nr_cpus_node(node);
  235. mem_data[node].pernode_addr = pernode;
  236. mem_data[node].pernode_size = pernodesize;
  237. memset(__va(pernode), 0, pernodesize);
  238. cpu_data = (void *)pernode;
  239. pernode += PERCPU_PAGE_SIZE * cpus;
  240. pernode += node * L1_CACHE_BYTES;
  241. pgdat_list[node] = __va(pernode);
  242. pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
  243. mem_data[node].node_data = __va(pernode);
  244. pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
  245. pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
  246. cpu_data = per_cpu_node_setup(cpu_data, node);
  247. return;
  248. }
  249. /**
  250. * find_pernode_space - allocate memory for memory map and per-node structures
  251. * @start: physical start of range
  252. * @len: length of range
  253. * @node: node where this range resides
  254. *
  255. * This routine reserves space for the per-cpu data struct, the list of
  256. * pg_data_ts and the per-node data struct. Each node will have something like
  257. * the following in the first chunk of addr. space large enough to hold it.
  258. *
  259. * ________________________
  260. * | |
  261. * |~~~~~~~~~~~~~~~~~~~~~~~~| <-- NODEDATA_ALIGN(start, node) for the first
  262. * | PERCPU_PAGE_SIZE * | start and length big enough
  263. * | cpus_on_this_node | Node 0 will also have entries for all non-existent cpus.
  264. * |------------------------|
  265. * | local pg_data_t * |
  266. * |------------------------|
  267. * | local ia64_node_data |
  268. * |------------------------|
  269. * | ??? |
  270. * |________________________|
  271. *
  272. * Once this space has been set aside, the bootmem maps are initialized. We
  273. * could probably move the allocation of the per-cpu and ia64_node_data space
  274. * outside of this function and use alloc_bootmem_node(), but doing it here
  275. * is straightforward and we get the alignments we want so...
  276. */
  277. static int __init find_pernode_space(unsigned long start, unsigned long len,
  278. int node)
  279. {
  280. unsigned long spfn, epfn;
  281. unsigned long pernodesize = 0, pernode;
  282. spfn = start >> PAGE_SHIFT;
  283. epfn = (start + len) >> PAGE_SHIFT;
  284. /*
  285. * Make sure this memory falls within this node's usable memory
  286. * since we may have thrown some away in build_maps().
  287. */
  288. if (spfn < mem_data[node].min_pfn || epfn > mem_data[node].max_pfn)
  289. return 0;
  290. /* Don't setup this node's local space twice... */
  291. if (mem_data[node].pernode_addr)
  292. return 0;
  293. /*
  294. * Calculate total size needed, incl. what's necessary
  295. * for good alignment and alias prevention.
  296. */
  297. pernodesize = compute_pernodesize(node);
  298. pernode = NODEDATA_ALIGN(start, node);
  299. /* Is this range big enough for what we want to store here? */
  300. if (start + len > (pernode + pernodesize))
  301. fill_pernode(node, pernode, pernodesize);
  302. return 0;
  303. }
  304. /**
  305. * reserve_pernode_space - reserve memory for per-node space
  306. *
  307. * Reserve the space used by the bootmem maps & per-node space in the boot
  308. * allocator so that when we actually create the real mem maps we don't
  309. * use their memory.
  310. */
  311. static void __init reserve_pernode_space(void)
  312. {
  313. unsigned long base, size;
  314. int node;
  315. for_each_online_node(node) {
  316. if (node_isset(node, memory_less_mask))
  317. continue;
  318. /* Now the per-node space */
  319. size = mem_data[node].pernode_size;
  320. base = __pa(mem_data[node].pernode_addr);
  321. memblock_reserve(base, size);
  322. }
  323. }
  324. static void __meminit scatter_node_data(void)
  325. {
  326. pg_data_t **dst;
  327. int node;
  328. /*
  329. * for_each_online_node() can't be used at here.
  330. * node_online_map is not set for hot-added nodes at this time,
  331. * because we are halfway through initialization of the new node's
  332. * structures. If for_each_online_node() is used, a new node's
  333. * pg_data_ptrs will be not initialized. Instead of using it,
  334. * pgdat_list[] is checked.
  335. */
  336. for_each_node(node) {
  337. if (pgdat_list[node]) {
  338. dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs;
  339. memcpy(dst, pgdat_list, sizeof(pgdat_list));
  340. }
  341. }
  342. }
  343. /**
  344. * initialize_pernode_data - fixup per-cpu & per-node pointers
  345. *
  346. * Each node's per-node area has a copy of the global pg_data_t list, so
  347. * we copy that to each node here, as well as setting the per-cpu pointer
  348. * to the local node data structure. The active_cpus field of the per-node
  349. * structure gets setup by the platform_cpu_init() function later.
  350. */
  351. static void __init initialize_pernode_data(void)
  352. {
  353. int cpu, node;
  354. scatter_node_data();
  355. #ifdef CONFIG_SMP
  356. /* Set the node_data pointer for each per-cpu struct */
  357. for_each_possible_early_cpu(cpu) {
  358. node = node_cpuid[cpu].nid;
  359. per_cpu(ia64_cpu_info, cpu).node_data =
  360. mem_data[node].node_data;
  361. }
  362. #else
  363. {
  364. struct cpuinfo_ia64 *cpu0_cpu_info;
  365. cpu = 0;
  366. node = node_cpuid[cpu].nid;
  367. cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
  368. ((char *)&ia64_cpu_info - __per_cpu_start));
  369. cpu0_cpu_info->node_data = mem_data[node].node_data;
  370. }
  371. #endif /* CONFIG_SMP */
  372. }
  373. /**
  374. * memory_less_node_alloc - * attempt to allocate memory on the best NUMA slit
  375. * node but fall back to any other node when __alloc_bootmem_node fails
  376. * for best.
  377. * @nid: node id
  378. * @pernodesize: size of this node's pernode data
  379. */
  380. static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
  381. {
  382. void *ptr = NULL;
  383. u8 best = 0xff;
  384. int bestnode = -1, node, anynode = 0;
  385. for_each_online_node(node) {
  386. if (node_isset(node, memory_less_mask))
  387. continue;
  388. else if (node_distance(nid, node) < best) {
  389. best = node_distance(nid, node);
  390. bestnode = node;
  391. }
  392. anynode = node;
  393. }
  394. if (bestnode == -1)
  395. bestnode = anynode;
  396. ptr = __alloc_bootmem_node(pgdat_list[bestnode], pernodesize,
  397. PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
  398. return ptr;
  399. }
  400. /**
  401. * memory_less_nodes - allocate and initialize CPU only nodes pernode
  402. * information.
  403. */
  404. static void __init memory_less_nodes(void)
  405. {
  406. unsigned long pernodesize;
  407. void *pernode;
  408. int node;
  409. for_each_node_mask(node, memory_less_mask) {
  410. pernodesize = compute_pernodesize(node);
  411. pernode = memory_less_node_alloc(node, pernodesize);
  412. fill_pernode(node, __pa(pernode), pernodesize);
  413. }
  414. return;
  415. }
  416. /**
  417. * find_memory - walk the EFI memory map and setup the bootmem allocator
  418. *
  419. * Called early in boot to setup the bootmem allocator, and to
  420. * allocate the per-cpu and per-node structures.
  421. */
  422. void __init find_memory(void)
  423. {
  424. int node;
  425. reserve_memory();
  426. efi_memmap_walk(filter_memory, register_active_ranges);
  427. if (num_online_nodes() == 0) {
  428. printk(KERN_ERR "node info missing!\n");
  429. node_set_online(0);
  430. }
  431. nodes_or(memory_less_mask, memory_less_mask, node_online_map);
  432. min_low_pfn = -1;
  433. max_low_pfn = 0;
  434. /* These actually end up getting called by call_pernode_memory() */
  435. efi_memmap_walk(filter_rsvd_memory, build_node_maps);
  436. efi_memmap_walk(filter_rsvd_memory, find_pernode_space);
  437. efi_memmap_walk(find_max_min_low_pfn, NULL);
  438. for_each_online_node(node)
  439. if (mem_data[node].min_pfn)
  440. node_clear(node, memory_less_mask);
  441. reserve_pernode_space();
  442. memory_less_nodes();
  443. initialize_pernode_data();
  444. max_pfn = max_low_pfn;
  445. find_initrd();
  446. }
  447. #ifdef CONFIG_SMP
  448. /**
  449. * per_cpu_init - setup per-cpu variables
  450. *
  451. * find_pernode_space() does most of this already, we just need to set
  452. * local_per_cpu_offset
  453. */
  454. void *per_cpu_init(void)
  455. {
  456. int cpu;
  457. static int first_time = 1;
  458. if (first_time) {
  459. first_time = 0;
  460. for_each_possible_early_cpu(cpu)
  461. per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
  462. }
  463. return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
  464. }
  465. #endif /* CONFIG_SMP */
  466. /**
  467. * call_pernode_memory - use SRAT to call callback functions with node info
  468. * @start: physical start of range
  469. * @len: length of range
  470. * @arg: function to call for each range
  471. *
  472. * efi_memmap_walk() knows nothing about layout of memory across nodes. Find
  473. * out to which node a block of memory belongs. Ignore memory that we cannot
  474. * identify, and split blocks that run across multiple nodes.
  475. *
  476. * Take this opportunity to round the start address up and the end address
  477. * down to page boundaries.
  478. */
  479. void call_pernode_memory(unsigned long start, unsigned long len, void *arg)
  480. {
  481. unsigned long rs, re, end = start + len;
  482. void (*func)(unsigned long, unsigned long, int);
  483. int i;
  484. start = PAGE_ALIGN(start);
  485. end &= PAGE_MASK;
  486. if (start >= end)
  487. return;
  488. func = arg;
  489. if (!num_node_memblks) {
  490. /* No SRAT table, so assume one node (node 0) */
  491. if (start < end)
  492. (*func)(start, end - start, 0);
  493. return;
  494. }
  495. for (i = 0; i < num_node_memblks; i++) {
  496. rs = max(start, node_memblk[i].start_paddr);
  497. re = min(end, node_memblk[i].start_paddr +
  498. node_memblk[i].size);
  499. if (rs < re)
  500. (*func)(rs, re - rs, node_memblk[i].nid);
  501. if (re == end)
  502. break;
  503. }
  504. }
  505. /**
  506. * paging_init - setup page tables
  507. *
  508. * paging_init() sets up the page tables for each node of the system and frees
  509. * the bootmem allocator memory for general use.
  510. */
  511. void __init paging_init(void)
  512. {
  513. unsigned long max_dma;
  514. unsigned long pfn_offset = 0;
  515. unsigned long max_pfn = 0;
  516. int node;
  517. unsigned long max_zone_pfns[MAX_NR_ZONES];
  518. max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
  519. sparse_memory_present_with_active_regions(MAX_NUMNODES);
  520. sparse_init();
  521. #ifdef CONFIG_VIRTUAL_MEM_MAP
  522. VMALLOC_END -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
  523. sizeof(struct page));
  524. vmem_map = (struct page *) VMALLOC_END;
  525. efi_memmap_walk(create_mem_map_page_table, NULL);
  526. printk("Virtual mem_map starts at 0x%p\n", vmem_map);
  527. #endif
  528. for_each_online_node(node) {
  529. pfn_offset = mem_data[node].min_pfn;
  530. #ifdef CONFIG_VIRTUAL_MEM_MAP
  531. NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset;
  532. #endif
  533. if (mem_data[node].max_pfn > max_pfn)
  534. max_pfn = mem_data[node].max_pfn;
  535. }
  536. memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
  537. #ifdef CONFIG_ZONE_DMA32
  538. max_zone_pfns[ZONE_DMA32] = max_dma;
  539. #endif
  540. max_zone_pfns[ZONE_NORMAL] = max_pfn;
  541. free_area_init_nodes(max_zone_pfns);
  542. zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
  543. }
  544. #ifdef CONFIG_MEMORY_HOTPLUG
  545. pg_data_t *arch_alloc_nodedata(int nid)
  546. {
  547. unsigned long size = compute_pernodesize(nid);
  548. return kzalloc(size, GFP_KERNEL);
  549. }
  550. void arch_free_nodedata(pg_data_t *pgdat)
  551. {
  552. kfree(pgdat);
  553. }
  554. void arch_refresh_nodedata(int update_node, pg_data_t *update_pgdat)
  555. {
  556. pgdat_list[update_node] = update_pgdat;
  557. scatter_node_data();
  558. }
  559. #endif
  560. #ifdef CONFIG_SPARSEMEM_VMEMMAP
  561. int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
  562. struct vmem_altmap *altmap)
  563. {
  564. return vmemmap_populate_basepages(start, end, node);
  565. }
  566. void vmemmap_free(unsigned long start, unsigned long end,
  567. struct vmem_altmap *altmap)
  568. {
  569. }
  570. #endif