git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mm: compaction: direct compact when a high-order allocation fails
[safe/jmp/linux-2.6]
/
mm
/
memory_hotplug.c
diff --git
a/mm/memory_hotplug.c
b/mm/memory_hotplug.c
index
2047465
..
be211a5
100644
(file)
--- a/
mm/memory_hotplug.c
+++ b/
mm/memory_hotplug.c
@@
-27,6
+27,8
@@
#include <linux/page-isolation.h>
#include <linux/pfn.h>
#include <linux/suspend.h>
#include <linux/page-isolation.h>
#include <linux/pfn.h>
#include <linux/suspend.h>
+#include <linux/mm_inline.h>
+#include <linux/firmware-map.h>
#include <asm/tlbflush.h>
#include <asm/tlbflush.h>
@@
-71,7
+73,9
@@
static void get_page_bootmem(unsigned long info, struct page *page, int type)
atomic_inc(&page->_count);
}
atomic_inc(&page->_count);
}
-void put_page_bootmem(struct page *page)
+/* reference to __meminit __free_pages_bootmem is valid
+ * so use __ref to tell modpost not to generate a warning */
+void __ref put_page_bootmem(struct page *page)
{
int type;
{
int type;
@@
-520,6
+524,9
@@
int __ref add_memory(int nid, u64 start, u64 size)
BUG_ON(ret);
}
BUG_ON(ret);
}
+ /* create new memmap entry */
+ firmware_map_add_hotplug(start, start + size, "System RAM");
+
goto out;
error:
goto out;
error:
@@
-672,15
+679,18
@@
do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
if (!ret) { /* Success */
list_add_tail(&page->lru, &source);
move_pages--;
if (!ret) { /* Success */
list_add_tail(&page->lru, &source);
move_pages--;
+ inc_zone_page_state(page, NR_ISOLATED_ANON +
+ page_is_file_cache(page));
+
} else {
/* Becasue we don't have big zone->lock. we should
check this again here. */
if (page_count(page))
not_managed++;
#ifdef CONFIG_DEBUG_VM
} else {
/* Becasue we don't have big zone->lock. we should
check this again here. */
if (page_count(page))
not_managed++;
#ifdef CONFIG_DEBUG_VM
- printk(KERN_
INFO "removing from LRU failed"
- " %lx/%d/%lx\n",
-
pfn, page_count(page), page->flags
);
+ printk(KERN_
ALERT "removing pfn %lx from LRU failed\n",
+ pfn);
+
dump_page(page
);
#endif
}
}
#endif
}
}
@@
-694,7
+704,7
@@
do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
if (list_empty(&source))
goto out;
/* this function returns # of failed pages */
if (list_empty(&source))
goto out;
/* this function returns # of failed pages */
- ret = migrate_pages(&source, hotremove_migrate_alloc, 0);
+ ret = migrate_pages(&source, hotremove_migrate_alloc, 0
, 1
);
out:
return ret;
out:
return ret;
@@
-747,7
+757,7
@@
check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
return offlined;
}
return offlined;
}
-int offline_pages(unsigned long start_pfn,
+
static
int offline_pages(unsigned long start_pfn,
unsigned long end_pfn, unsigned long timeout)
{
unsigned long pfn, nr_pages, expire;
unsigned long end_pfn, unsigned long timeout)
{
unsigned long pfn, nr_pages, expire;
@@
-849,6
+859,10
@@
repeat:
setup_per_zone_wmarks();
calculate_zone_inactive_ratio(zone);
setup_per_zone_wmarks();
calculate_zone_inactive_ratio(zone);
+ if (!node_present_pages(node)) {
+ node_clear_state(node, N_HIGH_MEMORY);
+ kswapd_stop(node);
+ }
vm_total_pages = nr_free_pagecache_pages();
writeback_set_ratelimit();
vm_total_pages = nr_free_pagecache_pages();
writeback_set_ratelimit();