diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-12 20:53:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-13 07:59:41 -0400 |
commit | 16440b5497cb3882d45b291147dbd61eb4951015 (patch) | |
tree | c028e012f4ca306537f406d4dc21146b7f22cf7f | |
parent | a93daee35a6d511e71f19c7227c64a9dc2c3e273 (diff) |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 71af7b5abe01..7d7add5ceba4 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -311,6 +311,12 @@ static int balloon(void *_vballoon) | |||
311 | else if (diff < 0) | 311 | else if (diff < 0) |
312 | leak_balloon(vb, -diff); | 312 | leak_balloon(vb, -diff); |
313 | update_balloon_size(vb); | 313 | update_balloon_size(vb); |
314 | |||
315 | /* | ||
316 | * For large balloon changes, we could spend a lot of time | ||
317 | * and always have work to do. Be nice if preempt disabled. | ||
318 | */ | ||
319 | cond_resched(); | ||
314 | } | 320 | } |
315 | return 0; | 321 | return 0; |
316 | } | 322 | } |