- set_wq_data(work, cwq);+ /* we own @work, set data and link */+ set_wq_data(work, cwq, extra_flags);+ /* * Ensure that we get the right work->data if we see the * result of list_add() below, see try_to_grab_pending(). */ smp_wmb();+ list_add_tail(&work->entry, head); wake_up(&cwq->more_work); }

static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)@@ -517,9 +555,6 @@ static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq) * * We sleep until all works which were queued on entry have been handled, * but we are not livelocked by new incoming ones.- *- * This function used to run the workqueues itself. Now we just wait for the- * helper threads to do it. */ void flush_workqueue(struct workqueue_struct *wq) {@@ -558,7 +593,6 @@ int flush_work(struct work_struct *work) lock_map_acquire(&cwq->wq->lockdep_map); lock_map_release(&cwq->wq->lockdep_map);