page_alloc.c (1f5026a7e21e409c2b9dd54f6dfb9446511fb7c5) page_alloc.c (5dfe8660a3d7f1ee1265c3536433ee53da3f98a3)
1/*
2 * linux/mm/page_alloc.c
3 *
4 * Manages the free list, the system allocates free pages here.
5 * Note that kmalloc() lives in slab.c
6 *
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 * Swap reorganised 29.12.95, Stephen Tweedie

--- 3889 unchanged lines hidden (view full) ---

3898 for_each_active_range_index_in_nid(i, nid) {
3899 start = early_node_map[i].start_pfn;
3900 end = early_node_map[i].end_pfn;
3901 nr_range = add_range(range, az, nr_range, start, end);
3902 }
3903 return nr_range;
3904}
3905
1/*
2 * linux/mm/page_alloc.c
3 *
4 * Manages the free list, the system allocates free pages here.
5 * Note that kmalloc() lives in slab.c
6 *
7 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
8 * Swap reorganised 29.12.95, Stephen Tweedie

--- 3889 unchanged lines hidden (view full) ---

3898 for_each_active_range_index_in_nid(i, nid) {
3899 start = early_node_map[i].start_pfn;
3900 end = early_node_map[i].end_pfn;
3901 nr_range = add_range(range, az, nr_range, start, end);
3902 }
3903 return nr_range;
3904}
3905
3906void __init work_with_active_regions(int nid, work_fn_t work_fn, void *data)
3907{
3908 int i;
3909 int ret;
3910
3911 for_each_active_range_index_in_nid(i, nid) {
3912 ret = work_fn(early_node_map[i].start_pfn,
3913 early_node_map[i].end_pfn, data);
3914 if (ret)
3915 break;
3916 }
3917}
3918/**
3919 * sparse_memory_present_with_active_regions - Call memory_present for each active range
3920 * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.
3921 *
3922 * If an architecture guarantees that all ranges registered with
3923 * add_active_ranges() contain no holes and may be freed, this
3924 * function may be used instead of calling memory_present() manually.
3925 */

--- 490 unchanged lines hidden (view full) ---

4416 nr_node_ids = highest + 1;
4417}
4418#else
4419static inline void setup_nr_node_ids(void)
4420{
4421}
4422#endif
4423
3906/**
3907 * sparse_memory_present_with_active_regions - Call memory_present for each active range
3908 * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.
3909 *
3910 * If an architecture guarantees that all ranges registered with
3911 * add_active_ranges() contain no holes and may be freed, this
3912 * function may be used instead of calling memory_present() manually.
3913 */

--- 490 unchanged lines hidden (view full) ---

4404 nr_node_ids = highest + 1;
4405}
4406#else
4407static inline void setup_nr_node_ids(void)
4408{
4409}
4410#endif
4411
4412/*
4413 * Common iterator interface used to define for_each_mem_pfn_range().
4414 */
4415void __meminit __next_mem_pfn_range(int *idx, int nid,
4416 unsigned long *out_start_pfn,
4417 unsigned long *out_end_pfn, int *out_nid)
4418{
4419 struct node_active_region *r = NULL;
4420
4421 while (++*idx < nr_nodemap_entries) {
4422 if (nid == MAX_NUMNODES || nid == early_node_map[*idx].nid) {
4423 r = &early_node_map[*idx];
4424 break;
4425 }
4426 }
4427 if (!r) {
4428 *idx = -1;
4429 return;
4430 }
4431
4432 if (out_start_pfn)
4433 *out_start_pfn = r->start_pfn;
4434 if (out_end_pfn)
4435 *out_end_pfn = r->end_pfn;
4436 if (out_nid)
4437 *out_nid = r->nid;
4438}
4439
4424/**
4425 * add_active_range - Register a range of PFNs backed by physical memory
4426 * @nid: The node ID the range resides on
4427 * @start_pfn: The start PFN of the available physical memory
4428 * @end_pfn: The end PFN of the available physical memory
4429 *
4430 * These ranges are stored in an early_node_map[] and later used by
4431 * free_area_init_nodes() to calculate zone sizes and holes. If the

--- 1369 unchanged lines hidden ---
4440/**
4441 * add_active_range - Register a range of PFNs backed by physical memory
4442 * @nid: The node ID the range resides on
4443 * @start_pfn: The start PFN of the available physical memory
4444 * @end_pfn: The end PFN of the available physical memory
4445 *
4446 * These ranges are stored in an early_node_map[] and later used by
4447 * free_area_init_nodes() to calculate zone sizes and holes. If the

--- 1369 unchanged lines hidden ---