LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Du, Changbin" <changbin.du@intel.com>
To: Tejun Heo <tj@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] workqueue: detect uninitated work_struct and BUG() if true
Date: Tue, 10 Mar 2015 13:20:02 +0000 [thread overview]
Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A01C9356F@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20150309062243.GL13283@htj.duckdns.org>
> -----Original Message-----
> From: Tejun Heo [mailto:htejun@gmail.com] On Behalf Of Tejun Heo
> Sent: Monday, March 9, 2015 2:23 PM
> To: Du, Changbin
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] workqueue: detect uninitated work_struct and BUG() if
> true
> > @@ -1295,6 +1295,9 @@ static void __queue_work(int cpu, struct
> workqueue_struct *wq,
> > */
> > WARN_ON_ONCE(!irqs_disabled());
> >
> > + if (!work->func)
> > + BUG();
> > +
> > debug_work_activate(work);
>
> Can't this be part of the debug_work mechanism? I'm a bit wary of adding
> essentially arbitrary checks. I'd much prefer if it gets gated by debug config
> somehow.
>
> Thanks.
> Tejun
Yes, I found there already have this checking and print a warning in work_fixup_activate.
So this patch can be droped. Thanks for point out.
static int work_fixup_activate(void *addr, enum debug_obj_state state)
{
struct work_struct *work = addr;
switch (state) {
case ODEBUG_STATE_NOTAVAILABLE:
/*
* This is not really a fixup. The work struct was
* statically initialized. We just make sure that it
* is tracked in the object tracker.
*/
if (test_bit(WORK_STRUCT_STATIC_BIT, work_data_bits(work))) {
debug_object_init(work, &work_debug_descr);
debug_object_activate(work, &work_debug_descr);
return 0;
}
WARN_ON_ONCE(1);
prev parent reply other threads:[~2015-03-10 13:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 4:43 Du, Changbin
2015-03-09 6:22 ` Tejun Heo
2015-03-10 13:20 ` Du, Changbin [this message]
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=0C18FE92A7765D4EB9EE5D38D86A563A01C9356F@SHSMSX103.ccr.corp.intel.com \
--to=changbin.du@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--subject='RE: [PATCH] workqueue: detect uninitated work_struct and BUG() if true' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).