Re: [PATCH 30/40] workqueue: implement work_busy()

From: Tejun Heo
Date: Mon Jan 18 2010 - 00:37:37 EST

Hello, Andy.

On 01/18/2010 11:52 AM, Andy Walls wrote:
>>From a driver writer's perspective, this function not useful since it is
> unreliable (false positives only?) and I have no way of
> "ensuring the workqueue @work was last queued on stays valid until this
> function returns."
> I don't quite know how to check and enfore a workqueue's continuing
> validity across the function call. (Maybe you could clarify?)

I don't really think that would be possible without tinkering with
workqueue internal locking.

> 2. Just schedule the work object and check the return value to see if
> the submission suceeded. If it did, the work was "not pending". This
> method can't check for "running" of course.

For workqueue, the above combined with proper subsystem locking would
be the best way to do it, I think.

> Is there some specific use case where this function is very useful
> despite being unreliable? I just think it's asking for abuse by someone
> who would think "mostly reliable" is good enough, when it actually may
> not be.

I mostly just wanted to keep the fscache debug printout which
indicates whether a fscache object has work pending or running. It's
a debug printout so it doesn't need to be reliable. If the debug
printout can be removed, this patch can go too.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at