aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshi Kani <[email protected]>2013-03-13 14:59:31 -0700
committerLinus Torvalds <[email protected]>2013-03-13 15:21:44 -0700
commitf8749452adcddd62e3707709ec2ae4856e70a3f2 (patch)
tree68258d007b645f51a0597d1f6f9ee53d2f92f3c8
parentebf47beb660e5580df7bee06d5cf9d37c0f22fac (diff)
mm: remove_memory(): fix end_pfn setting
remove_memory() calls walk_memory_range() with [start_pfn, end_pfn), where end_pfn is exclusive in this range. Therefore, end_pfn needs to be set to the next page of the end address. Signed-off-by: Toshi Kani <[email protected]> Cc: Wen Congyang <[email protected]> Cc: Tang Chen <[email protected]> Cc: Kamezawa Hiroyuki <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Jianguo Wu <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Wu Jianguo <[email protected]> Cc: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memory_hotplug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b81a367b9f39..9597eec8239d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1801,7 +1801,7 @@ int __ref remove_memory(int nid, u64 start, u64 size)
int retry = 1;
start_pfn = PFN_DOWN(start);
- end_pfn = start_pfn + PFN_DOWN(size);
+ end_pfn = PFN_UP(start + size - 1);
/*
* When CONFIG_MEMCG is on, one memory block may be used by other