Commits
Konstantin Khorenko authored and Pavel Emelianov committed 1a98ff3dcd5
Fix a livelock in stop machine A possible situation in stop_machine: - stopmachine_state == STOPMACHINE_WAIT; - STOPPER (stop_machine()) is in state SM_STOPPER_WAITING, calling yield() in a loop; - SLAVES (stopmachine()) also call yield() in a loop. This leads to the fairsched_lock suffering on all CPUs and in case of unfair getting lock rules (for example on NUMA node), some CPUs can wait for the lock forever/for a long time, causing a hang of the node. This patch replaces yield() by msleep(10). Mainstream kernel is affected as well, though it is harder to trigger: One CPU does yield() taking/releasing rq->lock, while another CPU should try to take that rq->lock (e.g. for balancing) and will livelock forever. Signed-off-by: Konstantin Khorenko <khorenko@openvz.org> Signed-off-by: Vasily Averin <vvs@openvz.org> Signed-off-by: Kirill Korotaev <dev@openvz.org> Signed-off-by: Pavel Emelianov <xemul@openvz.org>