lkml.org 
[lkml]   [2013]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] mm: remove_memory: Fix end_pfn setting
Date
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 <toshi.kani@hp.com>
---
mm/memory_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index ae7bcba..3e2ab7b 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

\
 
 \ /
  Last update: 2013-03-08 17:42    [W:0.032 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site