diff options
-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 4aa9f5bc6b2d..1ae602809efb 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -4311,6 +4311,12 @@ bool current_is_workqueue_rescuer(void) | |||
4311 | * no synchronization around this function and the test result is | 4311 | * no synchronization around this function and the test result is |
4312 | * unreliable and only useful as advisory hints or for debugging. | 4312 | * unreliable and only useful as advisory hints or for debugging. |
4313 | * | 4313 | * |
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 | * | ||
4314 | * RETURNS: | 4320 | * RETURNS: |
4315 | * %true if congested, %false otherwise. | 4321 | * %true if congested, %false otherwise. |
4316 | */ | 4322 | */ |
@@ -4321,6 +4327,9 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) | |||
4321 | 4327 | ||
4322 | rcu_read_lock_sched(); | 4328 | rcu_read_lock_sched(); |
4323 | 4329 | ||
4330 | if (cpu == WORK_CPU_UNBOUND) | ||
4331 | cpu = smp_processor_id(); | ||
4332 | |||
4324 | if (!(wq->flags & WQ_UNBOUND)) | 4333 | if (!(wq->flags & WQ_UNBOUND)) |
4325 | pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); | 4334 | pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); |
4326 | else | 4335 | else |