Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180183
b: refs/heads/master
c: ea08541
h: refs/heads/master
i:
  180181: 725686b
  180179: ae203fd
  180175: 2f4961d
v: v3
  • Loading branch information
Shaohui Zheng authored and Linus Torvalds committed Feb 3, 2010
1 parent cb5e40e commit 7811e8b
Show file tree
Hide file tree
Showing 2 changed files with 20 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: a225a5cc2c25e1217e68ee2ab8dd4454573fa308
refs/heads/master: ea0854170c95245a258b386c7a9314399c949fe0
19 changes: 19 additions & 0 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <asm/numa.h>
#include <asm/cacheflush.h>
#include <asm/init.h>
#include <linux/bootmem.h>

static unsigned long dma_reserve __initdata;

Expand Down Expand Up @@ -615,6 +616,21 @@ void __init paging_init(void)
* Memory hotplug specific functions
*/
#ifdef CONFIG_MEMORY_HOTPLUG
/*
* After memory hotplug the variables max_pfn, max_low_pfn and high_memory need
* updating.
*/
static void update_end_of_memory_vars(u64 start, u64 size)
{
unsigned long end_pfn = PFN_UP(start + size);

if (end_pfn > max_pfn) {
max_pfn = end_pfn;
max_low_pfn = end_pfn;
high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
}
}

/*
* Memory is added always to NORMAL zone. This means you will never get
* additional DMA/DMA32 memory.
Expand All @@ -634,6 +650,9 @@ int arch_add_memory(int nid, u64 start, u64 size)
ret = __add_pages(nid, zone, start_pfn, nr_pages);
WARN_ON_ONCE(ret);

/* update max_pfn, max_low_pfn and high_memory */
update_end_of_memory_vars(start, size);

return ret;
}
EXPORT_SYMBOL_GPL(arch_add_memory);
Expand Down

0 comments on commit 7811e8b

Please sign in to comment.