Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178053
b: refs/heads/master
c: 3299625
h: refs/heads/master
i:
  178051: 13cbeb8
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Dec 17, 2009
1 parent 44672b5 commit f2ca133
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45a94d7cd45ed991914011919e7d40eb6d2546d1
refs/heads/master: 329962503692b42d8088f31584e42d52db179d52
2 changes: 2 additions & 0 deletions trunk/arch/x86/mm/srat_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ int __init get_memcfg_from_srat(void)
e820_register_active_regions(chunk->nid, chunk->start_pfn,
min(chunk->end_pfn, max_pfn));
}
/* for out of order entries in SRAT */
sort_node_map();

for_each_online_node(nid) {
unsigned long start = node_start_pfn[nid];
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/mm/srat_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static int __init nodes_cover_memory(const struct bootnode *nodes)
unsigned long s = nodes[i].start >> PAGE_SHIFT;
unsigned long e = nodes[i].end >> PAGE_SHIFT;
pxmram += e - s;
pxmram -= absent_pages_in_range(s, e);
pxmram -= __absent_pages_in_range(i, s, e);
if ((long)pxmram < 0)
pxmram = 0;
}
Expand Down Expand Up @@ -373,6 +373,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
for_each_node_mask(i, nodes_parsed)
e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
nodes[i].end >> PAGE_SHIFT);
/* for out of order entries in SRAT */
sort_node_map();
if (!nodes_cover_memory(nodes)) {
bad_srat();
return -1;
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn,
extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
unsigned long end_pfn);
extern void remove_all_active_ranges(void);
void sort_node_map(void);
unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
unsigned long end_pfn);
extern unsigned long absent_pages_in_range(unsigned long start_pfn,
unsigned long end_pfn);
extern void get_pfn_range_for_nid(unsigned int nid,
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3573,7 +3573,7 @@ static unsigned long __meminit zone_spanned_pages_in_node(int nid,
* Return the number of holes in a range on a node. If nid is MAX_NUMNODES,
* then all holes in the requested range will be accounted for.
*/
static unsigned long __meminit __absent_pages_in_range(int nid,
unsigned long __meminit __absent_pages_in_range(int nid,
unsigned long range_start_pfn,
unsigned long range_end_pfn)
{
Expand Down Expand Up @@ -4102,7 +4102,7 @@ static int __init cmp_node_active_region(const void *a, const void *b)
}

/* sort the node_map by start_pfn */
static void __init sort_node_map(void)
void __init sort_node_map(void)
{
sort(early_node_map, (size_t)nr_nodemap_entries,
sizeof(struct node_active_region),
Expand Down

0 comments on commit f2ca133

Please sign in to comment.