Skip to content

Commit 7fb30d2

Browse files
committed
Merge branch 'for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue fix from Tejun Heo: "A fix for a workqueue_congested() regression that broke fscache" * 'for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: workqueue_congested() shouldn't translate WORK_CPU_UNBOUND into node number
2 parents a2c7a54 + d325185 commit 7fb30d2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎kernel/workqueue.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,12 @@ bool current_is_workqueue_rescuer(void)
43114311
* no synchronization around this function and the test result is
43124312
* unreliable and only useful as advisory hints or for debugging.
43134313
*
4314+
* If @cpu is WORK_CPU_UNBOUND, the test is performed on the local CPU.
4315+
* Note that both per-cpu and unbound workqueues may be associated with
4316+
* multiple pool_workqueues which have separate congested states. A
4317+
* workqueue being congested on one CPU doesn't mean the workqueue is also
4318+
* contested on other CPUs / NUMA nodes.
4319+
*
43144320
* RETURNS:
43154321
* %true if congested, %false otherwise.
43164322
*/
@@ -4321,6 +4327,9 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
43214327

43224328
rcu_read_lock_sched();
43234329

4330+
if (cpu == WORK_CPU_UNBOUND)
4331+
cpu = smp_processor_id();
4332+
43244333
if (!(wq->flags & WQ_UNBOUND))
43254334
pwq = per_cpu_ptr(wq->cpu_pwqs, cpu);
43264335
else

0 commit comments

Comments
 (0)