diff options
author | Wen Congyang <wency@cn.fujitsu.com> | 2012-12-11 19:00:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 20:22:22 -0500 |
commit | b023f46813cde6e3b8a8c24f432ff9c1fd8e9a64 (patch) | |
tree | edac3509e7c44136450e20d7f9cc81de35926650 /include/linux/page-isolation.h | |
parent | fa7194eb99b8e9fefe96f045002648ffb55f53c0 (diff) |
memory-hotplug: skip HWPoisoned page when offlining pages
hwpoisoned may be set when we offline a page by the sysfs interface
/sys/devices/system/memory/soft_offline_page or
/sys/devices/system/memory/hard_offline_page. If we don't clear
this flag when onlining pages, this page can't be freed, and will
not in free list. So we can't offline these pages again. So we
should skip such page when offlining pages.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page-isolation.h')
-rw-r--r-- | include/linux/page-isolation.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 76a9539cfd3f..a92061e08d48 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
@@ -2,7 +2,8 @@ | |||
2 | #define __LINUX_PAGEISOLATION_H | 2 | #define __LINUX_PAGEISOLATION_H |
3 | 3 | ||
4 | 4 | ||
5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count); | 5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, |
6 | bool skip_hwpoisoned_pages); | ||
6 | void set_pageblock_migratetype(struct page *page, int migratetype); | 7 | void set_pageblock_migratetype(struct page *page, int migratetype); |
7 | int move_freepages_block(struct zone *zone, struct page *page, | 8 | int move_freepages_block(struct zone *zone, struct page *page, |
8 | int migratetype); | 9 | int migratetype); |
@@ -21,7 +22,7 @@ int move_freepages(struct zone *zone, | |||
21 | */ | 22 | */ |
22 | int | 23 | int |
23 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, | 24 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, |
24 | unsigned migratetype); | 25 | unsigned migratetype, bool skip_hwpoisoned_pages); |
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. | 28 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. |
@@ -34,12 +35,13 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, | |||
34 | /* | 35 | /* |
35 | * Test all pages in [start_pfn, end_pfn) are isolated or not. | 36 | * Test all pages in [start_pfn, end_pfn) are isolated or not. |
36 | */ | 37 | */ |
37 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | 38 | int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn, |
39 | bool skip_hwpoisoned_pages); | ||
38 | 40 | ||
39 | /* | 41 | /* |
40 | * Internal functions. Changes pageblock's migrate type. | 42 | * Internal functions. Changes pageblock's migrate type. |
41 | */ | 43 | */ |
42 | int set_migratetype_isolate(struct page *page); | 44 | int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages); |
43 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); | 45 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); |
44 | struct page *alloc_migrate_target(struct page *page, unsigned long private, | 46 | struct page *alloc_migrate_target(struct page *page, unsigned long private, |
45 | int **resultp); | 47 | int **resultp); |