summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2014-03-13 11:23:38 +1030
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-13 13:32:48 +0200
commitf52e31dc5f5f61db5bd08576b8189ada2a8c9b82 (patch)
treea8de9c3b426af2e86f57b22b0d0fad5ca7ac25ee
parent771004298d9a73ff1bca0b4ff5168c74d3ff7af0 (diff)
downloadlwn-f52e31dc5f5f61db5bd08576b8189ada2a8c9b82.tar.gz
lwn-f52e31dc5f5f61db5bd08576b8189ada2a8c9b82.zip
virtio_balloon: don't softlockup on huge balloon changes.
commit 1f74ef0f2d7d692fcd615621e0e734c3e7771413 upstream. When adding or removing 100G from a balloon: BUG: soft lockup - CPU#0 stuck for 22s! [vballoon:367] We have a wait_event_interruptible(), but the condition is always true (more ballooning to do) so we don't ever sleep. We also have a wait_event() for the host to ack, but that is also always true as QEMU is synchronous for balloon operations. Reported-by: Gopesh Kumar Chaudhary <gopchaud@in.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/virtio/virtio_balloon.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 34bdabaecbd6..36e7859a31aa 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -310,6 +310,12 @@ static int balloon(void *_vballoon)
else if (diff < 0)
leak_balloon(vb, -diff);
update_balloon_size(vb);
+
+ /*
+ * For large balloon changes, we could spend a lot of time
+ * and always have work to do. Be nice if preempt disabled.
+ */
+ cond_resched();
}
return 0;
}