Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36143
b: refs/heads/master
c: 9c7cd68
h: refs/heads/master
i:
  36141: 73df0dc
  36139: 3123ec1
  36135: 262b874
  36127: 1019c0e
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Sep 27, 2006
1 parent 57a555d commit 69af338
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 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: 0e0b864e069c52a7b3e4a7da56e29b03a012fd75
refs/heads/master: 9c7cd6877cf8db15269163deda69392263124c1e
4 changes: 3 additions & 1 deletion trunk/arch/x86_64/mm/srat.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ static int reserve_hotadd(int node, unsigned long start, unsigned long end)

/* This check might be a bit too strict, but I'm keeping it for now. */
if (absent_pages_in_range(s_pfn, e_pfn) != e_pfn - s_pfn) {
printk(KERN_ERR "SRAT: Hotplug area has existing memory\n");
printk(KERN_ERR
"SRAT: Hotplug area %lu -> %lu has existing memory\n",
s_pfn, e_pfn);
return -1;
}

Expand Down
22 changes: 19 additions & 3 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,10 @@ unsigned long __init __absent_pages_in_range(int nid,
if (i == -1)
return 0;

/* Account for ranges before physical memory on this node */
if (early_node_map[i].start_pfn > range_start_pfn)
hole_pages = early_node_map[i].start_pfn - range_start_pfn;

prev_end_pfn = early_node_map[i].start_pfn;

/* Find all holes for the zone within the node */
Expand All @@ -2189,6 +2193,11 @@ unsigned long __init __absent_pages_in_range(int nid,
prev_end_pfn = early_node_map[i].end_pfn;
}

/* Account for ranges past physical memory on this node */
if (range_end_pfn > prev_end_pfn)
hole_pages = range_end_pfn -
max(range_start_pfn, prev_end_pfn);

return hole_pages;
}

Expand All @@ -2210,9 +2219,16 @@ unsigned long __init zone_absent_pages_in_node(int nid,
unsigned long zone_type,
unsigned long *ignored)
{
return __absent_pages_in_range(nid,
arch_zone_lowest_possible_pfn[zone_type],
arch_zone_highest_possible_pfn[zone_type]);
unsigned long node_start_pfn, node_end_pfn;
unsigned long zone_start_pfn, zone_end_pfn;

get_pfn_range_for_nid(nid, &node_start_pfn, &node_end_pfn);
zone_start_pfn = max(arch_zone_lowest_possible_pfn[zone_type],
node_start_pfn);
zone_end_pfn = min(arch_zone_highest_possible_pfn[zone_type],
node_end_pfn);

return __absent_pages_in_range(nid, zone_start_pfn, zone_end_pfn);
}

/* Return the zone index a PFN is in */
Expand Down

0 comments on commit 69af338

Please sign in to comment.