diff options
author | Joonsoo Kim <js1304@gmail.com> | 2012-08-15 10:25:37 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-08-16 17:21:15 -0400 |
commit | b75cac9368fa91636e17d0f7950b35d837154e14 (patch) | |
tree | 7f5fcdb6f57da351732c46d67b5d9d001fa54a0b /kernel/workqueue.c | |
parent | 330dad5b9c9555632578c00e94e85c122561c5c7 (diff) |
workqueue: correct req_cpu in trace_workqueue_queue_work()
When we do tracing workqueue_queue_work(), it records requested cpu.
But, if !(@wq->flag & WQ_UNBOUND) and @cpu is WORK_CPU_UNBOUND,
requested cpu is changed as local cpu.
In case of @wq->flag & WQ_UNBOUND, above change is not occured,
therefore it is reasonable to correct it.
Use temporary local variable for storing requested cpu.
Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 49d8f4a0110d..c29f2dc0f4fc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -1198,6 +1198,7 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq, | |||
1198 | struct cpu_workqueue_struct *cwq; | 1198 | struct cpu_workqueue_struct *cwq; |
1199 | struct list_head *worklist; | 1199 | struct list_head *worklist; |
1200 | unsigned int work_flags; | 1200 | unsigned int work_flags; |
1201 | unsigned int req_cpu = cpu; | ||
1201 | 1202 | ||
1202 | /* | 1203 | /* |
1203 | * While a work item is PENDING && off queue, a task trying to | 1204 | * While a work item is PENDING && off queue, a task trying to |
@@ -1253,7 +1254,7 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq, | |||
1253 | 1254 | ||
1254 | /* gcwq determined, get cwq and queue */ | 1255 | /* gcwq determined, get cwq and queue */ |
1255 | cwq = get_cwq(gcwq->cpu, wq); | 1256 | cwq = get_cwq(gcwq->cpu, wq); |
1256 | trace_workqueue_queue_work(cpu, cwq, work); | 1257 | trace_workqueue_queue_work(req_cpu, cwq, work); |
1257 | 1258 | ||
1258 | if (WARN_ON(!list_empty(&work->entry))) { | 1259 | if (WARN_ON(!list_empty(&work->entry))) { |
1259 | spin_unlock(&gcwq->lock); | 1260 | spin_unlock(&gcwq->lock); |