The patch titled ] core: workqueue: return on workqueue recursion has been added to the -mm tree. Its filename is core-workqueue-return-on-workqueue-recursion.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: ] core: workqueue: return on workqueue recursion From: Simon Kagstrom <simon.kagstrom@xxxxxxxxxxxxxx> When the workqueue is flushed from workqueue context (recursively), the system enters a strange state where things at random (dependent on the global workqueue) start misbehaving. For example, for us the console and logins locks up while the web server continues running. The system becomes unstable since the workqueue barrier locks the workqueue. This patch instead returns if the workqueue is flushed recursively, which keeps the workqueue alive but warns. Signed-off-by: Simon Kagstrom <simon.kagstrom@xxxxxxxxxxxxxx> Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/workqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN kernel/workqueue.c~core-workqueue-return-on-workqueue-recursion kernel/workqueue.c --- a/kernel/workqueue.c~core-workqueue-return-on-workqueue-recursion +++ a/kernel/workqueue.c @@ -482,7 +482,8 @@ static int flush_cpu_workqueue(struct cp int active = 0; struct wq_barrier barr; - WARN_ON(cwq->thread == current); + if (WARN_ON(cwq->thread == current)) + return 1; spin_lock_irq(&cwq->lock); if (!list_empty(&cwq->worklist) || cwq->current_work != NULL) { _ Patches currently in -mm which might be from simon.kagstrom@xxxxxxxxxxxxxx are linux-next.patch core-workqueue-return-on-workqueue-recursion.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html