提交 1f74ef0f 编写于 作者: R Rusty Russell

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: NGopesh Kumar Chaudhary <gopchaud@in.ibm.com>
Cc: stable@kernel.org
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 5e37f670
...@@ -310,6 +310,12 @@ static int balloon(void *_vballoon) ...@@ -310,6 +310,12 @@ static int balloon(void *_vballoon)
else if (diff < 0) else if (diff < 0)
leak_balloon(vb, -diff); leak_balloon(vb, -diff);
update_balloon_size(vb); 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; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册