[GIT PULL] workqueue fixes for v3.10-rc1

From: Tejun Heo
Date: Tue May 14 2013 - 11:58:19 EST


Hello, Linus.

Please pull from the following branch to receive a fix for
workqueue_congested() regression which broke fscache.

git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-3.10-fixes

Thanks.

workqueue: workqueue_congested() shouldn't translate WORK_CPU_UNBOUND into node number (2013-05-10 11:10:17 -0700)

----------------------------------------------------------------
Tejun Heo (1):
workqueue: workqueue_congested() shouldn't translate WORK_CPU_UNBOUND into node number

kernel/workqueue.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 4aa9f5b..1ae6028 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4311,6 +4311,12 @@ bool current_is_workqueue_rescuer(void)
* no synchronization around this function and the test result is
* unreliable and only useful as advisory hints or for debugging.
*
+ * If @cpu is WORK_CPU_UNBOUND, the test is performed on the local CPU.
+ * Note that both per-cpu and unbound workqueues may be associated with
+ * multiple pool_workqueues which have separate congested states. A
+ * workqueue being congested on one CPU doesn't mean the workqueue is also
+ * contested on other CPUs / NUMA nodes.
+ *
* RETURNS:
* %true if congested, %false otherwise.
*/
@@ -4321,6 +4327,9 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)

rcu_read_lock_sched();

+ if (cpu == WORK_CPU_UNBOUND)
+ cpu = smp_processor_id();
+
if (!(wq->flags & WQ_UNBOUND))
pwq = per_cpu_ptr(wq->cpu_pwqs, cpu);
else
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/