]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
UBUNTU:SAUCE: exec: fix lockup because retry loop may never exit
authorColin Ian King <colin.king@canonical.com>
Thu, 7 Dec 2017 17:32:33 +0000 (17:32 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:40:29 +0000 (11:40 +0100)
commit4d7b698bf28c3347831e89105454904bc0f41955
treeba5a8e31013731fb4f9b8230eceb2b97c03e2ea2
parent56390621eed648dd240ebbb1495b5c3cfd9b0da3
UBUNTU:SAUCE: exec: fix lockup because retry loop may never exit

BugLink: https://launchpad.net/bugs/1730717
My early fix for bug LP#1672819 could get stuck in an infinite
retry loop causing lockups.  Currently the retry is aggressively
spinning on a check and will never abort.  Relax the aggressive
retry by adding a small interruptible delay and limit the number
of retries.

I've analyzed the retries and 95% of the cases on an 8 CPU Xeon
host never hit the retry loop and less that 0.5% of retries are
ever more than 1 retry using the original reproducer program.
Considering that the reproducer is an extreeme case of forcing
the race condition I believe we now have a suitable balance of
non-aggressive CPU eating retries and a mechanism to bail out
after enough retries and avoid a lockup.

Admittedly this workaround is a bit of an ugly hack, but the
retry path is never executed for the majority of use cases and
only hits the retry/delay for the racy condition we hit with the
original bug.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/exec.c