lkml.org 
[lkml]   [2010]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] workqueue: fix cwq->nr_active underflow
Hello,

On 08/25/2010 11:11 AM, Johannes Berg wrote:
> Thanks Tejun. Come to think of it, since it's an underflow it should be
> easier for me to change the BUG_ON into a printk + BUG_ON() to print out
> the current value, and then reproduce -- that way I'll know when I hit
> the situation, which isn't trivial, and also whether I hit the
> underflow. Does that sound like a good thing to try to you?

Yeap, without the fix patch applied, that should confirm that we're
seeing the same failure, and with the patch applied, you can add a
printk in the else part of !delayed check in cwq_dec_nr_in_flight().
If the printk triggers and later rmmod dosen't trigger BUG_ON(), we
can be fairly sure the problem is fixed.

Thanks.

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index a2dccfc..b0d6ca4 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1702,7 +1702,9 @@ static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color,
if (cwq->nr_active < cwq->max_active)
cwq_activate_first_delayed(cwq);
}
- }
+ } else
+ printk("XXX %s: cwq_dec_nr_in_flight for a delayed work\n",
+ cwq->wq->name);

/* is flush in progress and are we at the flushing tip? */
if (likely(cwq->flush_color != color))
--
tejun


\
 
 \ /
  Last update: 2010-08-25 11:19    [W:0.095 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site