Re: workqueue destruction BUG_ON

From: Tejun Heo
Date: Tue Aug 24 2010 - 08:47:53 EST


Hello,

On 08/24/2010 10:55 AM, Johannes Berg wrote:
> In our testing with iwlwifi, we keep running into this BUG_ON:
>
> BUG_ON(cwq->nr_active);
>
> in destroy_workqueue(). This is quite unhelpful, and since the code
> flushes the workqueue I really don't see how this could be happening,
> unless maybe there's cross-talk between this and other workqueues?

Flushing the workqueue doesn't guarantee that the workqueue stays
empty. It just flushes the currently pending works. If there are
requeueing works or something else is queueing new works, workqueue
won't be empty. The check is new. Previously, workqueue code didn't
check whether the workqueue is actually empty. Now that the worklist
is shared, we need such check in place. There was also a similar
report on ath9k. I think it's most likely that something is queueing
works on a dying wokrqueue in the wireless common code. I'll prep a
debug patch to print out some details.

Thanks.

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