Skip to contentSkip to conversation

xen/balloon: cancel ballooning if adding new memory failed

PATCH In review David Vrabel 3 participants 9 messages Sep 1, 2014 – Jan 30, 2015 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/balloon: cancel ballooning if adding new memory failed

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

---
 drivers/xen/balloon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/xen/balloon.c +2 -2
index 5c660c7..1e0a317 100644
@@ -230,8 +230,8 @@ static enum bp_state reserve_additional_memory(long credit)
 	rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT);
 
 	if (rc) {
-		pr_info("%s: add_memory() failed: %i\n", __func__, rc);
-		return BP_EAGAIN;
+		pr_warn("Cannot add additional memory (%i)\n", rc);
+		return BP_ECANCELED;
 	}
 
 	balloon_hotplug -= credit;
Signature · 1 line
1.7.10.4
author Applied
#2 lore raw
Quoted 10 lines · Daniel Kiper
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

Make sense for me.

Applied to to stable/for-linus-3.17-b

Thanks.

David

#3 lore raw
In reply to David Vrabel
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

Ian.

Quoted 19 lines
---
 drivers/xen/balloon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/xen/balloon.c +2 -2
index 5c660c7..1e0a317 100644
@@ -230,8 +230,8 @@ static enum bp_state reserve_additional_memory(long credit)
 	rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT);
 
 	if (rc) {
-		pr_info("%s: add_memory() failed: %i\n", __func__, rc);
-		return BP_EAGAIN;
+		pr_warn("Cannot add additional memory (%i)\n", rc);
+		return BP_ECANCELED;
 	}
 
 	balloon_hotplug -= credit;
#4 lore raw
Quoted 10 lines · Ian Campbell
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

It's up to the distro kernel maintainer to request it if they think it is important. It's a harmless message with no side effects so I don't think it qualifies.

David

Quoted 20 lines
Quoted 18 lines
 drivers/xen/balloon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/xen/balloon.c +2 -2
index 5c660c7..1e0a317 100644
@@ -230,8 +230,8 @@ static enum bp_state reserve_additional_memory(long credit)
 	rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT);
 
 	if (rc) {
-		pr_info("%s: add_memory() failed: %i\n", __func__, rc);
-		return BP_EAGAIN;
+		pr_warn("Cannot add additional memory (%i)\n", rc);
+		return BP_ECANCELED;
 	}
 
 	balloon_hotplug -= credit;
#5 lore raw
Quoted 8 lines · David Vrabel
Quoted 7 lines · Ian Campbell
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

Quoted 7 lines
Quoted 3 lines

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

It's up to the distro kernel maintainer to request it if they think it is important. It's a harmless message with no side effects so I don't think it qualifies.

It pollutes system logs, makes unnecessary confusion and from time to time noise on various lists. Fix is trivial, so, why not. However, as David said this is up to stable kernel maintainer.

If yes you should also backport commit fd8b79511349efd1f0decea920f61b93acb34a75 (xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered). IIRC, both (trivial) patches are needed to fix this issue.

Daniel

#6 lore raw
In reply to David Vrabel
Quoted 6 lines · David Vrabel
Quoted 5 lines · Ian Campbell
Quoted 4 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

It's up to the distro kernel maintainer to request it if they think it is important.

Which is what I thought I was doing. Surely you don't think I should just ask stable@ without conferring with the relevant maintainers first?

Ian.

#7 lore raw
Quoted 13 lines · Ian Campbell
Quoted 12 lines · David Vrabel
Quoted 10 lines · Ian Campbell
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

Quoted 5 lines
Quoted 2 lines

It's up to the distro kernel maintainer to request it if they think it is important.

Which is what I thought I was doing. Surely you don't think I should just ask stable@ without conferring with the relevant maintainers first?

This fix doesn't even remotely qualify for stable. As stable_kernel_rules.txt says "In short, something critical."

You are of course free to send the request to stable@ yourself if you disagree.

David

#8 lore raw
Quoted 14 lines · David Vrabel
Quoted 13 lines · Ian Campbell
Quoted 12 lines · David Vrabel
Quoted 10 lines · Ian Campbell
Quoted 5 lines · David Vrabel

If the balloon driver is adding additional memory regions to the balloon and add_memory() fails it will likely continuously fail so cancel the balloon operation.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776448 and
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1304001 seem to suggest this should be a candidate for stable backports?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

It's up to the distro kernel maintainer to request it if they think it is important.

Which is what I thought I was doing. Surely you don't think I should just ask stable@ without conferring with the relevant maintainers first?

This fix doesn't even remotely qualify for stable. As stable_kernel_rules.txt says "In short, something critical."

Two people can selectively quote from rules.txt: "It must fix a real bug that bothers people" and from the bug "And they keep repeating forever, quite frequently.", seems like a good enough reason to me.

Quoted 2 lines

You are of course free to send the request to stable@ yourself if you disagree.

I've found your immediately dismissive attitude here quite off-putting and unnecessary. Of course it is completely reasonable of me to highlight a potential backport to the maintainers and the people CCd on the original patch.

Ian.