diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-12 20:53:38 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-12 20:57:55 -0400 |
commit | 1f74ef0f2d7d692fcd615621e0e734c3e7771413 (patch) | |
tree | 697a88da1944bc02ba82afd3758d01fb1b2f556a | |
parent | 5e37f67063a14450f1fff3baee81efe7c146592a (diff) |
virtio_balloon: don't softlockup on huge balloon changes.
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>
Cc: stable@kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | drivers/virtio/virtio_balloon.c | 6 |
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) | |||
310 | else if (diff < 0) | 310 | else if (diff < 0) |
311 | leak_balloon(vb, -diff); | 311 | leak_balloon(vb, -diff); |
312 | update_balloon_size(vb); | 312 | update_balloon_size(vb); |
313 | |||
314 | /* | ||
315 | * For large balloon changes, we could spend a lot of time | ||
316 | * and always have work to do. Be nice if preempt disabled. | ||
317 | */ | ||
318 | cond_resched(); | ||
313 | } | 319 | } |
314 | return 0; | 320 | return 0; |
315 | } | 321 | } |