Skip to content

Commit

Permalink
memcg: bugfix for memory hotplug
Browse files Browse the repository at this point in the history
The start pfn calculation in page_cgroup's memory hotplug notifier chain
is wrong.

Tested-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Nov 13, 2008
1 parent 6cdfcc2 commit 33c5d3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/page_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int online_page_cgroup(unsigned long start_pfn,
unsigned long start, end, pfn;
int fail = 0;

start = start_pfn & (PAGES_PER_SECTION - 1);
start = start_pfn & ~(PAGES_PER_SECTION - 1);
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION);

for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) {
Expand All @@ -188,7 +188,7 @@ int offline_page_cgroup(unsigned long start_pfn,
{
unsigned long start, end, pfn;

start = start_pfn & (PAGES_PER_SECTION - 1);
start = start_pfn & ~(PAGES_PER_SECTION - 1);
end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION);

for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION)
Expand Down

0 comments on commit 33c5d3d

Please sign in to comment.