Commits
Alexey Kuznetsov authored and Pavel Emelianov committed 45312ff8a98
[CPT] VE suspend cleanups The patch fixes one bug. Sometimes one process sleeps in an uninterruptible state waiting for some event depending on another process, which could be suspended. I know three such cases: 1. Process did vfork() and waits when child will exec() 2. Thread did exec() and waits when its siblings will die. 3. Thread makes coredump and waits when siblings stop. We detected case #1 directly by looking at tsk->vfork_done. In another places suspend timed out and failed, which is obviously incorrect. It is possible to handle cases #2,3 like we did with vfork, but it is not necessary. The patch suggests universal solution: we split suspend to several shorter rounds: the first round tries to suspend for 200msec, if it fails, VE is unfreezed and suspend is retried after some time. We repeat the attempts with increasing timeout until VE is frozen or major timeout (10sec) expires. Besides that, the patch reorders suspend code, so that it becomes more or less readable.