Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100167
b: refs/heads/master
c: 9958e81
h: refs/heads/master
i:
  100165: 90e12d9
  100163: c60475a
  100159: 257f13a
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Jul 13, 2008
1 parent ba2236e commit 0a760fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 965194c15dc9e4f3bc44432b39c441c86af7f11d
refs/heads/master: 9958e810f8ac92f8a447035ee6555420ba27b847
14 changes: 14 additions & 0 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,20 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
end_pfn = end>>PAGE_SHIFT;
nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);

/* try to merge same page size and continuous */
for (i = 0; nr_range > 1 && i < nr_range - 1; i++) {
unsigned long old_start;
if (mr[i].end != mr[i+1].start ||
mr[i].page_size_mask != mr[i+1].page_size_mask)
continue;
/* move it */
old_start = mr[i].start;
memmove(&mr[i], &mr[i+1],
(nr_range - 1 - i) * sizeof (struct map_range));
mr[i].start = old_start;
nr_range--;
}

for (i = 0; i < nr_range; i++)
printk(KERN_DEBUG " %010lx - %010lx page %s\n",
mr[i].start, mr[i].end,
Expand Down

0 comments on commit 0a760fc

Please sign in to comment.