In Linux Kernel Development 3rd edition.Chapter 8, 8.4.1.2
for (;;) { prepare_to_wait(&cwq->more_work, &wait, TASK_INTERRUPTIBLE); if (list_empty(&cwq->worklist)) schedule(); finish_wait(&cwq->more_work, &wait); run_workqueue(cwq);}
We can see prepare_to_wait() will add &wait into 'more_work' ( wait_queue_head_t )but the next line
if (list_empty(&cwq->worklist))
why list_empty check &cwq->workllist, not the 'morework' just processed?
I didn't see &cwq->worklist has any update here.