summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-09-21 10:44:55 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-21 10:44:55 -0400
commit07f0e62e7f2533918f28e780ab3cfeea1a63145d (patch)
treecb64b7cf275f1a5fd7f121f4f434e77dc6769e37 /kernel/workqueue.c
parentd7396f07358a7c6e22c238d36d1d85f9d652a414 (diff)
parent6e4664525b1db28f8c4e1130957f70a94c19213e (diff)
Merge tag 'v3.11' into for-linus
Linux 3.11
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7f5d4be22034..e93f7b9067d8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2201,6 +2201,15 @@ __acquires(&pool->lock)
dump_stack();
}
+ /*
+ * The following prevents a kworker from hogging CPU on !PREEMPT
+ * kernels, where a requeueing work item waiting for something to
+ * happen could deadlock with stop_machine as such work item could
+ * indefinitely requeue itself while all other CPUs are trapped in
+ * stop_machine.
+ */
+ cond_resched();
+
spin_lock_irq(&pool->lock);
/* clear cpu intensive status */