The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@tv-sign.ru>,
	Arjan van de Ven <arjan@infradead.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Thomas Sattler <tsattler@gmx.de>
Subject: Re: [PATCH] debug work struct cancel deadlocks with lockdep
Date: Thu, 05 Jul 2007 10:50:48 +0200	[thread overview]
Message-ID: <1183625448.3818.6.camel@johannes.berg> (raw)
In-Reply-To: <20070705084538.GA3476@elte.hu>

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

On Thu, 2007-07-05 at 10:45 +0200, Ingo Molnar wrote:

> > +#ifdef CONFIG_LOCKDEP
> > +		/*
> > +		 * It is permissible to free the struct work_struct
> > +		 * from inside the function that is called from it,
> > +		 * this we need to take into account for lockdep too.
> > +		 * To avoid bogus "held lock freed" warnings as well
> > +		 * as problems when looking into work->lockdep_map,
> > +		 * make a copy and use that here.
> > +		 */
> > +		struct lockdep_map lockdep_map = work->lockdep_map;
> > +#endif
> 
> > +		lock_acquire(&lockdep_map, 0, 0, 0, 2, _THIS_IP_);
> >  		f(work);
> > +		lock_release(&lockdep_map, 1, _THIS_IP_);
> 
> neat trick :)

Not like I had a choice ;) But since I assign .key it still works :)

Btw, do you have a tree you'll submit this through, or Oleg, or should I
send it to akpm after we sort out any further issues?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2007-07-05  8:49 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 [this message]
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
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=1183625448.3818.6.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox