[lkml]   [2019]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] powerpc/pseries/cmm: fix wrong managed page count when migrating between zones
In case we have to migrate a ballon page to a newpage of another zone, the
managed page count of both zones is wrong. Paired with memory offlining
(which will adjust the managed page count), we can trigger kernel crashes
and all kinds of different symptoms.

Fix it by properly adjusting the managed page count when migrating.

I did not try to reproduce on powerpc, however,I just resolved a long
known issue when ballooning+offlining in virtio-balloon. The same should
apply to powerpc/cmm since it started using the balloon compaction
infrastructure (luckily just recently).

Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction")
Cc: Benjamin Herrenschmidt <>
Cc: Paul Mackerras <>
Cc: Michael Ellerman <>
Cc: Andrew Morton <>
Cc: Richard Fontana <>
Cc: Greg Kroah-Hartman <>
Cc: Arun KS <>
Cc: Thomas Gleixner <>
Signed-off-by: David Hildenbrand <>

virtio-ballon fix with more details:

arch/powerpc/platforms/pseries/cmm.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 91571841df8a..665298fe2990 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -551,6 +551,10 @@ static int cmm_migratepage(struct balloon_dev_info *b_dev_info,

+ /* fixup the managed page count (esp. of the zone) */
+ adjust_managed_page_count(page, 1);
+ adjust_managed_page_count(newpage, -1);
/* balloon page list reference */

 \ /
  Last update: 2019-12-04 21:54    [W:0.027 / U:31.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site