LWN.net Logo

Re: 29-rc-mmotm - HID/USB wedge w/ WARNING: at kernel/workqueue.c:371

From:  Andrew Morton <akpm-AT-linux-foundation.org>
To:  Lai Jiangshan <laijs-AT-cn.fujitsu.com>
Subject:  Re: 29-rc-mmotm - HID/USB wedge w/ WARNING: at kernel/workqueue.c:371
Date:  Tue, 17 Mar 2009 19:50:04 -0700
Message-ID:  <20090317195004.18fb6af6.akpm@linux-foundation.org>
Cc:  Valdis.Kletnieks-AT-vt.edu, jkosina-AT-suse.cz, gregkh-AT-suse.de, linux-kernel-AT-vger.kernel.org, Oleg Nesterov <oleg-AT-tv-sign.ru>, Oliver Neukum <oliver-AT-neukum.org>
Archive-link:  Article, Thread

On Wed, 18 Mar 2009 10:29:40 +0800 Lai Jiangshan <laijs@cn.fujitsu.com> wrote:

> Valdis.Kletnieks@vt.edu wrote:
> > On Tue, 17 Mar 2009 13:54:24 PDT, Andrew Morton said:
> > 
> >> It's an error in workqueue-avoid-recursion-in-run_workqueue.patch, methinks.
> > 
> > Thanks for the diagnosis - I got as far as realizing that any backtrace that
> > included flush_cpu_workqueue() and worker_thread() had a problem and got
> > stuck there.
> > 
> 
> It's dangerous when we allow recursion in run_workqueue().

static void run_workqueue(struct cpu_workqueue_struct *cwq)
{
	spin_lock_irq(&cwq->lock);
	cwq->run_depth++;
	if (cwq->run_depth > 3) {
		/* morton gets to eat his hat */
		printk("%s: recursion depth exceeded: %d\n",
			__func__, cwq->run_depth);
		dump_stack();
	}

That was added five or six years ago, and I never ever got to eat my hat.

> If it's hard for you avoid flush_scheduled_work() in
> keventd's work fuction by other fix, you can create
> another workqueue to handle your works, IMO.

Why do we need to change anything here?  No known bugs were fixed, and some
new ones were added.



(Log in to post comments)

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds