Re: [PATCH] workqueue: consider work function when searching for busywork items

From: Andrey Isakov
Date: Wed Dec 19 2012 - 20:58:13 EST

I've merged the patch on my kernel version and did the same test, just to make sure. I confirm that the problem with deadlock is gone, thanks!
Well, actually, in my case I just did a kind of workaround by moving kfree to the very end of work functions and it worked. That still leaves some space for race conditions though.

Anyway, I know the driver code I am supporting overuses workqueues a bit, but it initially relied on the fact that there was a separate thread for each wq before, so it used both blocking and works allocating.
I had a hard time finding the cause of a workqueue suddenly stalling in one module apparently because of the blocked work in another one, and it is stated in the docs that both operations are supposed to be a valid use of wq.

It is nice to know that there is now a solution for the people who could step on the same rake as me.

Â----- Original Message -----
ÂFrom: Tejun Heo
ÂSent: 12/19/12 04:04 AM
ÂTo: andy51@xxxxxx
ÂSubject: [PATCH] workqueue: consider work function when searching for busy work items