2020-10-08 08:52:16

by Olaf Hering

[permalink] [raw]
Subject: [PATCH v1] hv_balloon: disable warning when floor reached

It is not an error if a the host requests to balloon down, but the VM
refuses to do so. Without this change a warning is logged in dmesg
every five minutes.

Fixes commit b3bb97b8a49f3

Signed-off-by: Olaf Hering <[email protected]>
---
drivers/hv/hv_balloon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 32e3bc0aa665..0f50295d0214 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1275,7 +1275,7 @@ static void balloon_up(struct work_struct *dummy)

/* Refuse to balloon below the floor. */
if (avail_pages < num_pages || avail_pages - num_pages < floor) {
- pr_warn("Balloon request will be partially fulfilled. %s\n",
+ pr_info("Balloon request will be partially fulfilled. %s\n",
avail_pages < num_pages ? "Not enough memory." :
"Balloon floor reached.");


2020-10-13 12:01:12

by Olaf Hering

[permalink] [raw]
Subject: Re: [PATCH v1] hv_balloon: disable warning when floor reached

Am Tue, 13 Oct 2020 09:17:17 +0000
schrieb Wei Liu <[email protected]>:

> So ... this patch is not needed anymore?

Why? A message is generated every 5 minutes. Unclear why this remained unnoticed since at least v5.3. I have added debug to my distro kernel to see what the involved variable values are. More info later today.

Olaf


Attachments:
(No filename) (849.00 B)
Digitale Signatur von OpenPGP

2020-10-13 12:01:41

by Wei Liu

[permalink] [raw]
Subject: Re: [PATCH v1] hv_balloon: disable warning when floor reached

On Tue, Oct 13, 2020 at 11:19:21AM +0200, Olaf Hering wrote:
> Am Tue, 13 Oct 2020 09:17:17 +0000
> schrieb Wei Liu <[email protected]>:
>
> > So ... this patch is not needed anymore?
>
> Why? A message is generated every 5 minutes. Unclear why this remained
> unnoticed since at least v5.3. I have added debug to my distro kernel
> to see what the involved variable values are. More info later today.

What I mean is you seem to have found a way to configure the system to
get what you want it to do. It was unclear to me whether this patch is
absolutely necessary from your last reply.

Some may consider the log informational (like you), some may think it
warrants a warning (because not enough memory). People also don't seem
to be particularly bother by it since its introduction in 4.10.

I have no objection to applying this patch. I can pick it up if I don't
hear objection in the next couple of days.

Wei.

>
> Olaf


2020-10-13 12:11:47

by Olaf Hering

[permalink] [raw]
Subject: Re: [PATCH v1] hv_balloon: disable warning when floor reached

Am Tue, 13 Oct 2020 11:19:21 +0200
schrieb Olaf Hering <[email protected]>:

> A message is generated every 5 minutes. Unclear why this remained unnoticed since at least v5.3. I have added debug to my distro kernel to see what the involved variable values are. More info later today.

The actual values for avail_pages, num_pages and floor are shown below.
The VM has min 512M, startup 1024M. If I interpret it correctly, the host requests to balloon down 83MB, while the VM has ~596MB assigned according to the GUI. free still reports 878MB.

Olaf

[ 66.917948] hv_balloon: Max. dynamic memory size: 2222 MB
[ 331.839393] hv_balloon: Balloon request will be partially fulfilled. (65875 32768 54728) Balloon floor reached.
[ 331.847451] hv_balloon: Balloon request will be partially fulfilled. (54745 21621 54728) Balloon floor reached.
[ 331.848480] hv_balloon: Balloon request will be partially fulfilled. (54745 21604 54728) Balloon floor reached.
[ 331.849465] hv_balloon: Balloon request will be partially fulfilled. (54745 21587 54728) Balloon floor reached.
[ 331.850463] hv_balloon: Balloon request will be partially fulfilled. (54745 21570 54728) Balloon floor reached.
[ 331.851393] hv_balloon: Balloon request will be partially fulfilled. (54682 21553 54728) Balloon floor reached.
[ 631.814538] hv_balloon: Balloon request will be partially fulfilled. (54801 21553 54728) Balloon floor reached.
[ 631.819084] hv_balloon: Balloon request will be partially fulfilled. (54801 21480 54728) Balloon floor reached.
[ 631.823487] hv_balloon: Balloon request will be partially fulfilled. (54738 21407 54728) Balloon floor reached.
[ 631.825832] hv_balloon: Balloon request will be partially fulfilled. (54738 21397 54728) Balloon floor reached.
[ 631.827988] hv_balloon: Balloon request will be partially fulfilled. (54738 21387 54728) Balloon floor reached.
[ 631.830111] hv_balloon: Balloon request will be partially fulfilled. (54738 21377 54728) Balloon floor reached.
[ 931.814649] hv_balloon: Balloon request will be partially fulfilled. (54406 21367 54728) Balloon floor reached.
[ 1231.829087] hv_balloon: Balloon request will be partially fulfilled. (54408 21367 54728) Balloon floor reached.
[ 1531.859374] hv_balloon: Balloon request will be partially fulfilled. (54416 21367 54728) Balloon floor reached.
[ 1831.874813] hv_balloon: Balloon request will be partially fulfilled. (54408 21367 54728) Balloon floor reached.
[ 2131.878262] hv_balloon: Balloon request will be partially fulfilled. (54672 21367 54728) Balloon floor reached.
[ 2431.895144] hv_balloon: Balloon request will be partially fulfilled. (54532 21367 54728) Balloon floor reached.
[ 2731.916792] hv_balloon: Balloon request will be partially fulfilled. (54609 21367 54728) Balloon floor reached.
[ 3031.922862] hv_balloon: Balloon request will be partially fulfilled. (54597 21367 54728) Balloon floor reached.
[ 3331.949145] hv_balloon: Balloon request will be partially fulfilled. (54615 21367 54728) Balloon floor reached.
[ 3631.957564] hv_balloon: Balloon request will be partially fulfilled. (54540 21367 54728) Balloon floor reached.
[ 3931.969477] hv_balloon: Balloon request will be partially fulfilled. (53057 21367 54728) Balloon floor reached.


Attachments:
(No filename) (849.00 B)
Digitale Signatur von OpenPGP

2020-10-19 10:03:43

by Michael Kelley (LINUX)

[permalink] [raw]
Subject: RE: [PATCH v1] hv_balloon: disable warning when floor reached

From: Wei Liu <[email protected]>
>
> On Tue, Oct 13, 2020 at 11:19:21AM +0200, Olaf Hering wrote:
> > Am Tue, 13 Oct 2020 09:17:17 +0000
> > schrieb Wei Liu <[email protected]>:
> >
> > > So ... this patch is not needed anymore?
> >
> > Why? A message is generated every 5 minutes. Unclear why this remained
> > unnoticed since at least v5.3. I have added debug to my distro kernel
> > to see what the involved variable values are. More info later today.
>
> What I mean is you seem to have found a way to configure the system to
> get what you want it to do. It was unclear to me whether this patch is
> absolutely necessary from your last reply.
>
> Some may consider the log informational (like you), some may think it
> warrants a warning (because not enough memory). People also don't seem
> to be particularly bother by it since its introduction in 4.10.
>
> I have no objection to applying this patch. I can pick it up if I don't
> hear objection in the next couple of days.
>

I think we should take the patch. We've had a complaint about the noisy
output from another source as well, so it was on my list of small things
to clean up. Thanks for doing it Olaf.

I'll send a separate Reviewed-by:

Michael

2020-10-19 10:06:01

by Michael Kelley (LINUX)

[permalink] [raw]
Subject: RE: [PATCH v1] hv_balloon: disable warning when floor reached

From: Olaf Hering <[email protected]> Sent: Thursday, October 8, 2020 12:12 AM
>
> It is not an error if a the host requests to balloon down, but the VM

Spurious word "a"

> refuses to do so. Without this change a warning is logged in dmesg
> every five minutes.
>
> Fixes commit b3bb97b8a49f3

This "Fixes" line isn't formatted correctly. Should be:

Fixes: b3bb97b8a49f3 ("Drivers: hv: balloon: Add logging for dynamic memory operations")

>
> Signed-off-by: Olaf Hering <[email protected]>
> ---
> drivers/hv/hv_balloon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> index 32e3bc0aa665..0f50295d0214 100644
> --- a/drivers/hv/hv_balloon.c
> +++ b/drivers/hv/hv_balloon.c
> @@ -1275,7 +1275,7 @@ static void balloon_up(struct work_struct *dummy)
>
> /* Refuse to balloon below the floor. */
> if (avail_pages < num_pages || avail_pages - num_pages < floor) {
> - pr_warn("Balloon request will be partially fulfilled. %s\n",
> + pr_info("Balloon request will be partially fulfilled. %s\n",
> avail_pages < num_pages ? "Not enough memory." :
> "Balloon floor reached.");
>

Above nits notwithstanding,

Reviewed-by: Michael Kelley <[email protected]>

2020-10-19 10:22:11

by Olaf Hering

[permalink] [raw]
Subject: Re: [PATCH v1] hv_balloon: disable warning when floor reached

Am Mon, 19 Oct 2020 02:58:08 +0000
schrieb Michael Kelley <[email protected]>:

> I think we should take the patch.

Thanks. I just briefly looked at the code, did not understand much of it. But it feels like the math uses the wrong input. I think its is not the 'pr_warn' that needs changing, the 'Fixes' tag would also be incorrect because a 4.12+backports kernel does not show the warning.

Olaf


Attachments:
(No filename) (849.00 B)
Digitale Signatur von OpenPGP

2020-10-20 01:26:17

by Wei Liu

[permalink] [raw]
Subject: Re: [PATCH v1] hv_balloon: disable warning when floor reached

On Mon, Oct 19, 2020 at 03:02:22AM +0000, Michael Kelley wrote:
> From: Olaf Hering <[email protected]> Sent: Thursday, October 8, 2020 12:12 AM
> >
> > It is not an error if a the host requests to balloon down, but the VM
>
> Spurious word "a"
>
> > refuses to do so. Without this change a warning is logged in dmesg
> > every five minutes.
> >
> > Fixes commit b3bb97b8a49f3
>
> This "Fixes" line isn't formatted correctly. Should be:
>
> Fixes: b3bb97b8a49f3 ("Drivers: hv: balloon: Add logging for dynamic memory operations")
>
> >
> > Signed-off-by: Olaf Hering <[email protected]>
> > ---
> > drivers/hv/hv_balloon.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> > index 32e3bc0aa665..0f50295d0214 100644
> > --- a/drivers/hv/hv_balloon.c
> > +++ b/drivers/hv/hv_balloon.c
> > @@ -1275,7 +1275,7 @@ static void balloon_up(struct work_struct *dummy)
> >
> > /* Refuse to balloon below the floor. */
> > if (avail_pages < num_pages || avail_pages - num_pages < floor) {
> > - pr_warn("Balloon request will be partially fulfilled. %s\n",
> > + pr_info("Balloon request will be partially fulfilled. %s\n",
> > avail_pages < num_pages ? "Not enough memory." :
> > "Balloon floor reached.");
> >
>
> Above nits notwithstanding,
>
> Reviewed-by: Michael Kelley <[email protected]>

Thanks. I see one for and no against so far.

I've applied this patch to hyperv-fixes. I also fixed those nits
while at it.

Wei.