mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "workqueue: fix possible livelock with concurrent mod_delayed_work()"
This commit is contained in:
commit
d142f00cbe
1 changed files with 8 additions and 0 deletions
|
|
@ -50,6 +50,8 @@
|
|||
#include <linux/uaccess.h>
|
||||
#include <linux/sched/isolation.h>
|
||||
#include <linux/nmi.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include "workqueue_internal.h"
|
||||
|
||||
|
|
@ -1305,6 +1307,12 @@ fail:
|
|||
if (work_is_canceling(work))
|
||||
return -ENOENT;
|
||||
cpu_relax();
|
||||
/*
|
||||
* The queueing is in progress in another context. If we keep
|
||||
* taking the pool->lock in a busy loop, the other context may
|
||||
* never get the lock. Give 1 usec delay to avoid this contention.
|
||||
*/
|
||||
udelay(1);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue