diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-03-13 11:23:38 +1030 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-04-30 16:23:22 +0100 |
commit | d7a04a3b663789ecfd80c4eeea742c73d3ccb540 (patch) | |
tree | e1dffc191156fd191173d3fa0a88a272668680d2 /drivers/virtio/virtio_balloon.c | |
parent | 769ddc4b6571f1b9766f2fa3d9e2c78cfc1afdeb (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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/virtio/virtio_balloon.c')
-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 94fd738a774..28153fb2225 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -271,6 +271,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; } |