From: Andrew Morton flush_work() requires that the caller pass in the workqueue to be flushed. But for keventd-based works, callers require access to keventd_wq, which is provate to workqueue.c. Add the new flush_work_keventd() wrapper to handle this. The naming in there is insane. We should come up with some consistent scheme to distinguish the things which operate on keventd_wq from the things which operate upon caller-owned workqueues. I'd propose "name of the function with _keventd" appended, as in this patch. Cc: Oleg Nesterov Signed-off-by: Andrew Morton --- include/linux/workqueue.h | 1 + kernel/workqueue.c | 6 ++++++ 2 files changed, 7 insertions(+) diff -puN include/linux/workqueue.h~implement-flush_work_keventd include/linux/workqueue.h --- a/include/linux/workqueue.h~implement-flush_work_keventd +++ a/include/linux/workqueue.h @@ -179,6 +179,7 @@ extern int queue_delayed_work_on(int cpu struct delayed_work *work, unsigned long delay); extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); extern void flush_work(struct workqueue_struct *wq, struct work_struct *work); +extern void flush_work_keventd(struct work_struct *work); extern int FASTCALL(schedule_work(struct work_struct *work)); extern int FASTCALL(run_scheduled_work(struct work_struct *work)); diff -puN kernel/workqueue.c~implement-flush_work_keventd kernel/workqueue.c --- a/kernel/workqueue.c~implement-flush_work_keventd +++ a/kernel/workqueue.c @@ -733,6 +733,12 @@ void flush_scheduled_work(void) } EXPORT_SYMBOL(flush_scheduled_work); +void flush_work_keventd(struct work_struct *work) +{ + flush_work(keventd_wq, work); +} +EXPORT_SYMBOL(flush_work_keventd); + /** * cancel_rearming_delayed_workqueue - reliably kill off a delayed work whose handler rearms the delayed work. * @wq: the controlling workqueue structure _