bootmem.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /*
  2. * bootmem - A boot-time physical memory allocator and configurator
  3. *
  4. * Copyright (C) 1999 Ingo Molnar
  5. * 1999 Kanoj Sarcar, SGI
  6. * 2008 Johannes Weiner
  7. *
  8. * Access to this subsystem has to be serialized externally (which is true
  9. * for the boot process anyway).
  10. */
  11. #include <linux/init.h>
  12. #include <linux/pfn.h>
  13. #include <linux/bootmem.h>
  14. #include <linux/module.h>
  15. #include <asm/bug.h>
  16. #include <asm/io.h>
  17. #include <asm/processor.h>
  18. #include "internal.h"
  19. unsigned long max_low_pfn;
  20. unsigned long min_low_pfn;
  21. unsigned long max_pfn;
  22. #ifdef CONFIG_CRASH_DUMP
  23. /*
  24. * If we have booted due to a crash, max_pfn will be a very low value. We need
  25. * to know the amount of memory that the previous kernel used.
  26. */
  27. unsigned long saved_max_pfn;
  28. #endif
  29. bootmem_data_t bootmem_node_data[MAX_NUMNODES] __initdata;
  30. static struct list_head bdata_list __initdata = LIST_HEAD_INIT(bdata_list);
  31. static int bootmem_debug;
  32. static int __init bootmem_debug_setup(char *buf)
  33. {
  34. bootmem_debug = 1;
  35. return 0;
  36. }
  37. early_param("bootmem_debug", bootmem_debug_setup);
  38. #define bdebug(fmt, args...) ({ \
  39. if (unlikely(bootmem_debug)) \
  40. printk(KERN_INFO \
  41. "bootmem::%s " fmt, \
  42. __FUNCTION__, ## args); \
  43. })
  44. static unsigned long __init bootmap_bytes(unsigned long pages)
  45. {
  46. unsigned long bytes = (pages + 7) / 8;
  47. return ALIGN(bytes, sizeof(long));
  48. }
  49. /**
  50. * bootmem_bootmap_pages - calculate bitmap size in pages
  51. * @pages: number of pages the bitmap has to represent
  52. */
  53. unsigned long __init bootmem_bootmap_pages(unsigned long pages)
  54. {
  55. unsigned long bytes = bootmap_bytes(pages);
  56. return PAGE_ALIGN(bytes) >> PAGE_SHIFT;
  57. }
  58. /*
  59. * link bdata in order
  60. */
  61. static void __init link_bootmem(bootmem_data_t *bdata)
  62. {
  63. struct list_head *iter;
  64. list_for_each(iter, &bdata_list) {
  65. bootmem_data_t *ent;
  66. ent = list_entry(iter, bootmem_data_t, list);
  67. if (bdata->node_min_pfn < ent->node_min_pfn)
  68. break;
  69. }
  70. list_add_tail(&bdata->list, iter);
  71. }
  72. /*
  73. * Called once to set up the allocator itself.
  74. */
  75. static unsigned long __init init_bootmem_core(bootmem_data_t *bdata,
  76. unsigned long mapstart, unsigned long start, unsigned long end)
  77. {
  78. unsigned long mapsize;
  79. mminit_validate_memmodel_limits(&start, &end);
  80. bdata->node_bootmem_map = phys_to_virt(PFN_PHYS(mapstart));
  81. bdata->node_min_pfn = start;
  82. bdata->node_low_pfn = end;
  83. link_bootmem(bdata);
  84. /*
  85. * Initially all pages are reserved - setup_arch() has to
  86. * register free RAM areas explicitly.
  87. */
  88. mapsize = bootmap_bytes(end - start);
  89. memset(bdata->node_bootmem_map, 0xff, mapsize);
  90. bdebug("nid=%td start=%lx map=%lx end=%lx mapsize=%lx\n",
  91. bdata - bootmem_node_data, start, mapstart, end, mapsize);
  92. return mapsize;
  93. }
  94. /**
  95. * init_bootmem_node - register a node as boot memory
  96. * @pgdat: node to register
  97. * @freepfn: pfn where the bitmap for this node is to be placed
  98. * @startpfn: first pfn on the node
  99. * @endpfn: first pfn after the node
  100. *
  101. * Returns the number of bytes needed to hold the bitmap for this node.
  102. */
  103. unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
  104. unsigned long startpfn, unsigned long endpfn)
  105. {
  106. return init_bootmem_core(pgdat->bdata, freepfn, startpfn, endpfn);
  107. }
  108. /**
  109. * init_bootmem - register boot memory
  110. * @start: pfn where the bitmap is to be placed
  111. * @pages: number of available physical pages
  112. *
  113. * Returns the number of bytes needed to hold the bitmap.
  114. */
  115. unsigned long __init init_bootmem(unsigned long start, unsigned long pages)
  116. {
  117. max_low_pfn = pages;
  118. min_low_pfn = start;
  119. return init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages);
  120. }
  121. static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
  122. {
  123. int aligned;
  124. struct page *page;
  125. unsigned long start, end, pages, count = 0;
  126. if (!bdata->node_bootmem_map)
  127. return 0;
  128. start = bdata->node_min_pfn;
  129. end = bdata->node_low_pfn;
  130. /*
  131. * If the start is aligned to the machines wordsize, we might
  132. * be able to free pages in bulks of that order.
  133. */
  134. aligned = !(start & (BITS_PER_LONG - 1));
  135. bdebug("nid=%td start=%lx end=%lx aligned=%d\n",
  136. bdata - bootmem_node_data, start, end, aligned);
  137. while (start < end) {
  138. unsigned long *map, idx, vec;
  139. map = bdata->node_bootmem_map;
  140. idx = start - bdata->node_min_pfn;
  141. vec = ~map[idx / BITS_PER_LONG];
  142. if (aligned && vec == ~0UL && start + BITS_PER_LONG < end) {
  143. int order = ilog2(BITS_PER_LONG);
  144. __free_pages_bootmem(pfn_to_page(start), order);
  145. count += BITS_PER_LONG;
  146. } else {
  147. unsigned long off = 0;
  148. while (vec && off < BITS_PER_LONG) {
  149. if (vec & 1) {
  150. page = pfn_to_page(start + off);
  151. __free_pages_bootmem(page, 0);
  152. count++;
  153. }
  154. vec >>= 1;
  155. off++;
  156. }
  157. }
  158. start += BITS_PER_LONG;
  159. }
  160. page = virt_to_page(bdata->node_bootmem_map);
  161. pages = bdata->node_low_pfn - bdata->node_min_pfn;
  162. pages = bootmem_bootmap_pages(pages);
  163. count += pages;
  164. while (pages--)
  165. __free_pages_bootmem(page++, 0);
  166. bdebug("nid=%td released=%lx\n", bdata - bootmem_node_data, count);
  167. return count;
  168. }
  169. /**
  170. * free_all_bootmem_node - release a node's free pages to the buddy allocator
  171. * @pgdat: node to be released
  172. *
  173. * Returns the number of pages actually released.
  174. */
  175. unsigned long __init free_all_bootmem_node(pg_data_t *pgdat)
  176. {
  177. register_page_bootmem_info_node(pgdat);
  178. return free_all_bootmem_core(pgdat->bdata);
  179. }
  180. /**
  181. * free_all_bootmem - release free pages to the buddy allocator
  182. *
  183. * Returns the number of pages actually released.
  184. */
  185. unsigned long __init free_all_bootmem(void)
  186. {
  187. return free_all_bootmem_core(NODE_DATA(0)->bdata);
  188. }
  189. static void __init __free(bootmem_data_t *bdata,
  190. unsigned long sidx, unsigned long eidx)
  191. {
  192. unsigned long idx;
  193. bdebug("nid=%td start=%lx end=%lx\n", bdata - bootmem_node_data,
  194. sidx + bdata->node_min_pfn,
  195. eidx + bdata->node_min_pfn);
  196. if (bdata->hint_idx > sidx)
  197. bdata->hint_idx = sidx;
  198. for (idx = sidx; idx < eidx; idx++)
  199. if (!test_and_clear_bit(idx, bdata->node_bootmem_map))
  200. BUG();
  201. }
  202. static int __init __reserve(bootmem_data_t *bdata, unsigned long sidx,
  203. unsigned long eidx, int flags)
  204. {
  205. unsigned long idx;
  206. int exclusive = flags & BOOTMEM_EXCLUSIVE;
  207. bdebug("nid=%td start=%lx end=%lx flags=%x\n",
  208. bdata - bootmem_node_data,
  209. sidx + bdata->node_min_pfn,
  210. eidx + bdata->node_min_pfn,
  211. flags);
  212. for (idx = sidx; idx < eidx; idx++)
  213. if (test_and_set_bit(idx, bdata->node_bootmem_map)) {
  214. if (exclusive) {
  215. __free(bdata, sidx, idx);
  216. return -EBUSY;
  217. }
  218. bdebug("silent double reserve of PFN %lx\n",
  219. idx + bdata->node_min_pfn);
  220. }
  221. return 0;
  222. }
  223. static int __init mark_bootmem_node(bootmem_data_t *bdata,
  224. unsigned long start, unsigned long end,
  225. int reserve, int flags)
  226. {
  227. unsigned long sidx, eidx;
  228. bdebug("nid=%td start=%lx end=%lx reserve=%d flags=%x\n",
  229. bdata - bootmem_node_data, start, end, reserve, flags);
  230. BUG_ON(start < bdata->node_min_pfn);
  231. BUG_ON(end > bdata->node_low_pfn);
  232. sidx = start - bdata->node_min_pfn;
  233. eidx = end - bdata->node_min_pfn;
  234. if (reserve)
  235. return __reserve(bdata, sidx, eidx, flags);
  236. else
  237. __free(bdata, sidx, eidx);
  238. return 0;
  239. }
  240. static int __init mark_bootmem(unsigned long start, unsigned long end,
  241. int reserve, int flags)
  242. {
  243. unsigned long pos;
  244. bootmem_data_t *bdata;
  245. pos = start;
  246. list_for_each_entry(bdata, &bdata_list, list) {
  247. int err;
  248. unsigned long max;
  249. if (pos < bdata->node_min_pfn ||
  250. pos >= bdata->node_low_pfn) {
  251. BUG_ON(pos != start);
  252. continue;
  253. }
  254. max = min(bdata->node_low_pfn, end);
  255. err = mark_bootmem_node(bdata, pos, max, reserve, flags);
  256. if (reserve && err) {
  257. mark_bootmem(start, pos, 0, 0);
  258. return err;
  259. }
  260. if (max == end)
  261. return 0;
  262. pos = bdata->node_low_pfn;
  263. }
  264. BUG();
  265. }
  266. /**
  267. * free_bootmem_node - mark a page range as usable
  268. * @pgdat: node the range resides on
  269. * @physaddr: starting address of the range
  270. * @size: size of the range in bytes
  271. *
  272. * Partial pages will be considered reserved and left as they are.
  273. *
  274. * The range must reside completely on the specified node.
  275. */
  276. void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
  277. unsigned long size)
  278. {
  279. unsigned long start, end;
  280. start = PFN_UP(physaddr);
  281. end = PFN_DOWN(physaddr + size);
  282. mark_bootmem_node(pgdat->bdata, start, end, 0, 0);
  283. }
  284. /**
  285. * free_bootmem - mark a page range as usable
  286. * @addr: starting address of the range
  287. * @size: size of the range in bytes
  288. *
  289. * Partial pages will be considered reserved and left as they are.
  290. *
  291. * The range must be contiguous but may span node boundaries.
  292. */
  293. void __init free_bootmem(unsigned long addr, unsigned long size)
  294. {
  295. unsigned long start, end;
  296. start = PFN_UP(addr);
  297. end = PFN_DOWN(addr + size);
  298. mark_bootmem(start, end, 0, 0);
  299. }
  300. /**
  301. * reserve_bootmem_node - mark a page range as reserved
  302. * @pgdat: node the range resides on
  303. * @physaddr: starting address of the range
  304. * @size: size of the range in bytes
  305. * @flags: reservation flags (see linux/bootmem.h)
  306. *
  307. * Partial pages will be reserved.
  308. *
  309. * The range must reside completely on the specified node.
  310. */
  311. int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
  312. unsigned long size, int flags)
  313. {
  314. unsigned long start, end;
  315. start = PFN_DOWN(physaddr);
  316. end = PFN_UP(physaddr + size);
  317. return mark_bootmem_node(pgdat->bdata, start, end, 1, flags);
  318. }
  319. #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
  320. /**
  321. * reserve_bootmem - mark a page range as usable
  322. * @addr: starting address of the range
  323. * @size: size of the range in bytes
  324. * @flags: reservation flags (see linux/bootmem.h)
  325. *
  326. * Partial pages will be reserved.
  327. *
  328. * The range must be contiguous but may span node boundaries.
  329. */
  330. int __init reserve_bootmem(unsigned long addr, unsigned long size,
  331. int flags)
  332. {
  333. unsigned long start, end;
  334. start = PFN_DOWN(addr);
  335. end = PFN_UP(addr + size);
  336. return mark_bootmem(start, end, 1, flags);
  337. }
  338. #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
  339. static void * __init alloc_bootmem_core(struct bootmem_data *bdata,
  340. unsigned long size, unsigned long align,
  341. unsigned long goal, unsigned long limit)
  342. {
  343. unsigned long fallback = 0;
  344. unsigned long min, max, start, sidx, midx, step;
  345. BUG_ON(!size);
  346. BUG_ON(align & (align - 1));
  347. BUG_ON(limit && goal + size > limit);
  348. if (!bdata->node_bootmem_map)
  349. return NULL;
  350. bdebug("nid=%td size=%lx [%lu pages] align=%lx goal=%lx limit=%lx\n",
  351. bdata - bootmem_node_data, size, PAGE_ALIGN(size) >> PAGE_SHIFT,
  352. align, goal, limit);
  353. min = bdata->node_min_pfn;
  354. max = bdata->node_low_pfn;
  355. goal >>= PAGE_SHIFT;
  356. limit >>= PAGE_SHIFT;
  357. if (limit && max > limit)
  358. max = limit;
  359. if (max <= min)
  360. return NULL;
  361. step = max(align >> PAGE_SHIFT, 1UL);
  362. if (goal && min < goal && goal < max)
  363. start = ALIGN(goal, step);
  364. else
  365. start = ALIGN(min, step);
  366. sidx = start - bdata->node_min_pfn;;
  367. midx = max - bdata->node_min_pfn;
  368. if (bdata->hint_idx > sidx) {
  369. /*
  370. * Handle the valid case of sidx being zero and still
  371. * catch the fallback below.
  372. */
  373. fallback = sidx + 1;
  374. sidx = ALIGN(bdata->hint_idx, step);
  375. }
  376. while (1) {
  377. int merge;
  378. void *region;
  379. unsigned long eidx, i, start_off, end_off;
  380. find_block:
  381. sidx = find_next_zero_bit(bdata->node_bootmem_map, midx, sidx);
  382. sidx = ALIGN(sidx, step);
  383. eidx = sidx + PFN_UP(size);
  384. if (sidx >= midx || eidx > midx)
  385. break;
  386. for (i = sidx; i < eidx; i++)
  387. if (test_bit(i, bdata->node_bootmem_map)) {
  388. sidx = ALIGN(i, step);
  389. if (sidx == i)
  390. sidx += step;
  391. goto find_block;
  392. }
  393. if (bdata->last_end_off &&
  394. PFN_DOWN(bdata->last_end_off) + 1 == sidx)
  395. start_off = ALIGN(bdata->last_end_off, align);
  396. else
  397. start_off = PFN_PHYS(sidx);
  398. merge = PFN_DOWN(start_off) < sidx;
  399. end_off = start_off + size;
  400. bdata->last_end_off = end_off;
  401. bdata->hint_idx = PFN_UP(end_off);
  402. /*
  403. * Reserve the area now:
  404. */
  405. if (__reserve(bdata, PFN_DOWN(start_off) + merge,
  406. PFN_UP(end_off), BOOTMEM_EXCLUSIVE))
  407. BUG();
  408. region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
  409. start_off);
  410. memset(region, 0, size);
  411. return region;
  412. }
  413. if (fallback) {
  414. sidx = ALIGN(fallback - 1, step);
  415. fallback = 0;
  416. goto find_block;
  417. }
  418. return NULL;
  419. }
  420. static void * __init ___alloc_bootmem_nopanic(unsigned long size,
  421. unsigned long align,
  422. unsigned long goal,
  423. unsigned long limit)
  424. {
  425. bootmem_data_t *bdata;
  426. restart:
  427. list_for_each_entry(bdata, &bdata_list, list) {
  428. void *region;
  429. if (goal && bdata->node_low_pfn <= PFN_DOWN(goal))
  430. continue;
  431. if (limit && bdata->node_min_pfn >= PFN_DOWN(limit))
  432. break;
  433. region = alloc_bootmem_core(bdata, size, align, goal, limit);
  434. if (region)
  435. return region;
  436. }
  437. if (goal) {
  438. goal = 0;
  439. goto restart;
  440. }
  441. return NULL;
  442. }
  443. /**
  444. * __alloc_bootmem_nopanic - allocate boot memory without panicking
  445. * @size: size of the request in bytes
  446. * @align: alignment of the region
  447. * @goal: preferred starting address of the region
  448. *
  449. * The goal is dropped if it can not be satisfied and the allocation will
  450. * fall back to memory below @goal.
  451. *
  452. * Allocation may happen on any node in the system.
  453. *
  454. * Returns NULL on failure.
  455. */
  456. void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
  457. unsigned long goal)
  458. {
  459. return ___alloc_bootmem_nopanic(size, align, goal, 0);
  460. }
  461. static void * __init ___alloc_bootmem(unsigned long size, unsigned long align,
  462. unsigned long goal, unsigned long limit)
  463. {
  464. void *mem = ___alloc_bootmem_nopanic(size, align, goal, limit);
  465. if (mem)
  466. return mem;
  467. /*
  468. * Whoops, we cannot satisfy the allocation request.
  469. */
  470. printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
  471. panic("Out of memory");
  472. return NULL;
  473. }
  474. /**
  475. * __alloc_bootmem - allocate boot memory
  476. * @size: size of the request in bytes
  477. * @align: alignment of the region
  478. * @goal: preferred starting address of the region
  479. *
  480. * The goal is dropped if it can not be satisfied and the allocation will
  481. * fall back to memory below @goal.
  482. *
  483. * Allocation may happen on any node in the system.
  484. *
  485. * The function panics if the request can not be satisfied.
  486. */
  487. void * __init __alloc_bootmem(unsigned long size, unsigned long align,
  488. unsigned long goal)
  489. {
  490. return ___alloc_bootmem(size, align, goal, 0);
  491. }
  492. static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata,
  493. unsigned long size, unsigned long align,
  494. unsigned long goal, unsigned long limit)
  495. {
  496. void *ptr;
  497. ptr = alloc_bootmem_core(bdata, size, align, goal, limit);
  498. if (ptr)
  499. return ptr;
  500. return ___alloc_bootmem(size, align, goal, limit);
  501. }
  502. /**
  503. * __alloc_bootmem_node - allocate boot memory from a specific node
  504. * @pgdat: node to allocate from
  505. * @size: size of the request in bytes
  506. * @align: alignment of the region
  507. * @goal: preferred starting address of the region
  508. *
  509. * The goal is dropped if it can not be satisfied and the allocation will
  510. * fall back to memory below @goal.
  511. *
  512. * Allocation may fall back to any node in the system if the specified node
  513. * can not hold the requested memory.
  514. *
  515. * The function panics if the request can not be satisfied.
  516. */
  517. void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
  518. unsigned long align, unsigned long goal)
  519. {
  520. return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
  521. }
  522. #ifdef CONFIG_SPARSEMEM
  523. /**
  524. * alloc_bootmem_section - allocate boot memory from a specific section
  525. * @size: size of the request in bytes
  526. * @section_nr: sparse map section to allocate from
  527. *
  528. * Return NULL on failure.
  529. */
  530. void * __init alloc_bootmem_section(unsigned long size,
  531. unsigned long section_nr)
  532. {
  533. bootmem_data_t *bdata;
  534. unsigned long pfn, goal, limit;
  535. pfn = section_nr_to_pfn(section_nr);
  536. goal = pfn << PAGE_SHIFT;
  537. limit = section_nr_to_pfn(section_nr + 1) << PAGE_SHIFT;
  538. bdata = &bootmem_node_data[early_pfn_to_nid(pfn)];
  539. return alloc_bootmem_core(bdata, size, SMP_CACHE_BYTES, goal, limit);
  540. }
  541. #endif
  542. void * __init __alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size,
  543. unsigned long align, unsigned long goal)
  544. {
  545. void *ptr;
  546. ptr = alloc_bootmem_core(pgdat->bdata, size, align, goal, 0);
  547. if (ptr)
  548. return ptr;
  549. return __alloc_bootmem_nopanic(size, align, goal);
  550. }
  551. #ifndef ARCH_LOW_ADDRESS_LIMIT
  552. #define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
  553. #endif
  554. /**
  555. * __alloc_bootmem_low - allocate low boot memory
  556. * @size: size of the request in bytes
  557. * @align: alignment of the region
  558. * @goal: preferred starting address of the region
  559. *
  560. * The goal is dropped if it can not be satisfied and the allocation will
  561. * fall back to memory below @goal.
  562. *
  563. * Allocation may happen on any node in the system.
  564. *
  565. * The function panics if the request can not be satisfied.
  566. */
  567. void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
  568. unsigned long goal)
  569. {
  570. return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
  571. }
  572. /**
  573. * __alloc_bootmem_low_node - allocate low boot memory from a specific node
  574. * @pgdat: node to allocate from
  575. * @size: size of the request in bytes
  576. * @align: alignment of the region
  577. * @goal: preferred starting address of the region
  578. *
  579. * The goal is dropped if it can not be satisfied and the allocation will
  580. * fall back to memory below @goal.
  581. *
  582. * Allocation may fall back to any node in the system if the specified node
  583. * can not hold the requested memory.
  584. *
  585. * The function panics if the request can not be satisfied.
  586. */
  587. void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
  588. unsigned long align, unsigned long goal)
  589. {
  590. return ___alloc_bootmem_node(pgdat->bdata, size, align,
  591. goal, ARCH_LOW_ADDRESS_LIMIT);
  592. }