Commit f8749452 authored by Toshi Kani's avatar Toshi Kani Committed by Linus Torvalds

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: default avatarToshi Kani <toshi.kani@hp.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Wu Jianguo <wujianguo@huawei.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ebf47beb
...@@ -1801,7 +1801,7 @@ int __ref remove_memory(int nid, u64 start, u64 size) ...@@ -1801,7 +1801,7 @@ int __ref remove_memory(int nid, u64 start, u64 size)
int retry = 1; int retry = 1;
start_pfn = PFN_DOWN(start); 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 * When CONFIG_MEMCG is on, one memory block may be used by other
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment