lkml.org 
[lkml]   [2013]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/13] workqueue: fix work_busy()
于 2013/2/5 3:54, Tejun Heo 写道:
> Hello, Lai.
>
> On Fri, Feb 01, 2013 at 02:41:25AM +0800, Lai Jiangshan wrote:
>> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
>> index 973b290..d474a6c 100644
>> --- a/kernel/workqueue.c
>> +++ b/kernel/workqueue.c
>> @@ -3443,8 +3443,6 @@ EXPORT_SYMBOL_GPL(workqueue_congested);
>> * Test whether @work is currently pending or running. There is no
>> * synchronization around this function and the test result is
>> * unreliable and only useful as advisory hints or for debugging.
>> - * Especially for reentrant wqs, the pending state might hide the
>> - * running state.
>
> Yeap, this is no longer true.
>
>> *
>> * RETURNS:
>> * OR'd bitmask of WORK_BUSY_* bits.
>> @@ -3453,15 +3451,13 @@ unsigned int work_busy(struct work_struct *work)
>> {
>> struct worker_pool *pool = get_work_pool(work);
>> unsigned long flags;
>> - unsigned int ret = 0;
>> + unsigned int ret = work_pending(work) ? WORK_BUSY_PENDING : 0;
>
> I'd prefer this as a if() statement.
>
>> if (!pool)
>> - return 0;
>> + return ret;
>
> I'm a bit confused. When can we be pending w/o pool?
>

grab the pending bits <==time==> really queued
^
this patch considers the work is busy in this time

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-02-05 13:41    [W:0.342 / U:1.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site