diff options
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6f019219ddbd..e52d002d3893 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2188,6 +2188,15 @@ __acquires(&pool->lock) | |||
2188 | dump_stack(); | 2188 | dump_stack(); |
2189 | } | 2189 | } |
2190 | 2190 | ||
2191 | /* | ||
2192 | * The following prevents a kworker from hogging CPU on !PREEMPT | ||
2193 | * kernels, where a requeueing work item waiting for something to | ||
2194 | * happen could deadlock with stop_machine as such work item could | ||
2195 | * indefinitely requeue itself while all other CPUs are trapped in | ||
2196 | * stop_machine. | ||
2197 | */ | ||
2198 | cond_resched(); | ||
2199 | |||
2191 | spin_lock_irq(&pool->lock); | 2200 | spin_lock_irq(&pool->lock); |
2192 | 2201 | ||
2193 | /* clear cpu intensive status */ | 2202 | /* clear cpu intensive status */ |