From: Tejun Heo <tj@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] workqueue: fix cwq->nr_active underflow
Date: Wed, 25 Aug 2010 11:12:02 +0200 [thread overview]
Message-ID: <4C74DE62.6040208@kernel.org> (raw)
In-Reply-To: <1282727501.3685.7.camel@jlt3.sipsolutions.net>
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
next prev parent reply other threads:[~2010-08-25 9:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 8:52 [PATCH] workqueue: fix cwq->nr_active underflow Tejun Heo
2010-08-25 9:11 ` Johannes Berg
2010-08-25 9:12 ` Tejun Heo [this message]
2010-08-25 9:20 ` Johannes Berg
2010-08-25 14:25 ` Johannes Berg
2010-08-25 14:21 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C74DE62.6040208@kernel.org \
--to=tj@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.