diff options
author | Wang Nan <wangnan0@huawei.com> | 2014-08-06 19:06:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:18 -0400 |
commit | 1a4dc5bc7cb5659a8004d105afeb0571126f8f56 (patch) | |
tree | d3b95ffec47f6e6155e8a95efdcbc26cc1255e12 /include/linux/mmzone.h | |
parent | b69deb2b7e13f04da5c0684c7ce19e788736ab0d (diff) |
mem-hotplug: improve zone_movable_is_highmem logic
In original code, zone_movable_is_highmem() assumes ZONE_MOVABLE not
highmem if CONFIG_HAVE_MEMBLOCK_NODE_MAP is not set. In online_pages,
it extracts pages from the previous zone before ZONE_MOVABLE. Which is
logically inconsistent:
If HAVE_MEMBLOCK_NODE_MAP is turned off but HIGHMEM is on,
zone_movable_is_highmem() makes movable zone not highmem, but
online_pages() extracts pages from ZONE_HIGHMEM.
This inconsistency doesn't cause real problem currently, because all
architectures support online_pages also have HAVE_MEMBLOCK_NODE_MAP.
However, fixing it makes code clear, and also helps futher coding.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Zhang Zhen <zhangzhen@huawei.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6cbd1b6c3d20..559e659288fc 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -872,6 +872,8 @@ static inline int zone_movable_is_highmem(void) | |||
872 | { | 872 | { |
873 | #if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) | 873 | #if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) |
874 | return movable_zone == ZONE_HIGHMEM; | 874 | return movable_zone == ZONE_HIGHMEM; |
875 | #elif defined(CONFIG_HIGHMEM) | ||
876 | return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM; | ||
875 | #else | 877 | #else |
876 | return 0; | 878 | return 0; |
877 | #endif | 879 | #endif |