Skip to content

Commit

Permalink
mm: remove_memory(): fix end_pfn setting
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Toshi Kani authored and torvalds committed Mar 13, 2013
1 parent ebf47be commit f874945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f874945

Please sign in to comment.