From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Ingo Molnar <mingo@elte.hu>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@tv-sign.ru>,
Arjan van de Ven <arjan@infradead.org>,
Thomas Sattler <tsattler@gmx.de>
Subject: Re: [PATCH] debug work struct cancel deadlocks with lockdep
Date: Thu, 05 Jul 2007 11:01:10 +0200 [thread overview]
Message-ID: <1183626070.7054.54.camel@twins> (raw)
In-Reply-To: <1183625889.3818.14.camel@johannes.berg>
On Thu, 2007-07-05 at 10:58 +0200, Johannes Berg wrote:
> On Thu, 2007-07-05 at 10:53 +0200, Ingo Molnar wrote:
>
> > > +#ifdef CONFIG_LOCKDEP
> > > +/*
> > > + * HACK! This really should call lockdep_init_map() but can't
> > > + * because there's no requirement to initialise work structs
> > > + * at runtime. This works because subclass == 0.
> > > + *
> > > + * NB: because we have to copy the lockdep_map, setting .key
> > > + * here is required!
> > > + */
> >
> > why do you consider this a hack? A static object is a static object, and
> > its own address is its key. That's what we have for like 80% of all the
> > spinlocks in the kernel. Static initialization is not as flexible as
> > dynamic initialization, but the lockdep engine handles it. Am i missing
> > something?
>
> Well, there's nothing in lockdep that guarantees that. I'd be much more
> comfortable doing that when lockdep had a STATIC_LOCKDEP_MAP_INIT()
> macro that looks like my __WORK_INIT_LOCKDEP_MAP() macro because then
> people changing lockdep would see that they cannot rely on
> lockdep_init_map() having been called (unless subclass != 0)
You could of course make this STATIC_LOCKDEP_MAP_INIT() and place it
near lockdep_init_map() :-)
That way it would be clear that changes to either ought to be reflected
in the other.
next prev parent reply other threads:[~2007-07-05 9:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-04 21:12 [PATCH] debug work struct cancel deadlocks with lockdep Johannes Berg
2007-07-05 8:45 ` Ingo Molnar
2007-07-05 8:50 ` Johannes Berg
2007-07-05 8:54 ` Ingo Molnar
2007-07-05 8:53 ` Ingo Molnar
2007-07-05 8:58 ` Johannes Berg
2007-07-05 9:01 ` Peter Zijlstra [this message]
2007-07-05 9:08 ` Johannes Berg
2007-07-05 9:10 ` Peter Zijlstra
2007-07-05 9:19 ` Johannes Berg
2007-07-05 9:03 ` Peter Zijlstra
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=1183626070.7054.54.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=arjan@infradead.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=tsattler@gmx.de \
/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.