All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled
@ 2019-12-12 14:17 ` Juergen Gross
  0 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2019-12-12 14:17 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini

When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined
reserve_additional_memory() will set balloon_stats.target_pages to a
wrong value in case there are still some ballooned pages allocated via
alloc_xenballooned_pages().

This will result in balloon_process() no longer be triggered when
ballooned pages are freed in batches.

Reported-by: Nicholas Tsirakis <niko.tsirakis@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 4f2e78a5e4db..0c142bcab79d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -394,7 +394,8 @@ static struct notifier_block xen_memory_nb = {
 #else
 static enum bp_state reserve_additional_memory(void)
 {
-	balloon_stats.target_pages = balloon_stats.current_pages;
+	balloon_stats.target_pages = balloon_stats.current_pages +
+				     balloon_stats.target_unpopulated;
 	return BP_ECANCELED;
 }
 #endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Xen-devel] [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled
@ 2019-12-12 14:17 ` Juergen Gross
  0 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2019-12-12 14:17 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini

When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined
reserve_additional_memory() will set balloon_stats.target_pages to a
wrong value in case there are still some ballooned pages allocated via
alloc_xenballooned_pages().

This will result in balloon_process() no longer be triggered when
ballooned pages are freed in batches.

Reported-by: Nicholas Tsirakis <niko.tsirakis@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 4f2e78a5e4db..0c142bcab79d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -394,7 +394,8 @@ static struct notifier_block xen_memory_nb = {
 #else
 static enum bp_state reserve_additional_memory(void)
 {
-	balloon_stats.target_pages = balloon_stats.current_pages;
+	balloon_stats.target_pages = balloon_stats.current_pages +
+				     balloon_stats.target_unpopulated;
 	return BP_ECANCELED;
 }
 #endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled
  2019-12-12 14:17 ` [Xen-devel] " Juergen Gross
@ 2019-12-12 18:30   ` Boris Ostrovsky
  -1 siblings, 0 replies; 4+ messages in thread
From: Boris Ostrovsky @ 2019-12-12 18:30 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, linux-kernel; +Cc: Stefano Stabellini



On 12/12/19 9:17 AM, Juergen Gross wrote:
> When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined
> reserve_additional_memory() will set balloon_stats.target_pages to a
> wrong value in case there are still some ballooned pages allocated via
> alloc_xenballooned_pages().
>
> This will result in balloon_process() no longer be triggered when
> ballooned pages are freed in batches.
>
> Reported-by: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled
@ 2019-12-12 18:30   ` Boris Ostrovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Ostrovsky @ 2019-12-12 18:30 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, linux-kernel; +Cc: Stefano Stabellini



On 12/12/19 9:17 AM, Juergen Gross wrote:
> When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined
> reserve_additional_memory() will set balloon_stats.target_pages to a
> wrong value in case there are still some ballooned pages allocated via
> alloc_xenballooned_pages().
>
> This will result in balloon_process() no longer be triggered when
> ballooned pages are freed in batches.
>
> Reported-by: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-12 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 14:17 [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled Juergen Gross
2019-12-12 14:17 ` [Xen-devel] " Juergen Gross
2019-12-12 18:30 ` Boris Ostrovsky
2019-12-12 18:30   ` [Xen-devel] " Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.