mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: hrtimers: simplify lockdep handling
Date: Wed, 25 Jun 2008 15:46:37 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0806251539180.405@gandalf.stny.rr.com> (raw)


Hi Oleg,

I'm currently porting -rt to 26-rc7 and I came across this change:

Commit:     8e60e05fdc7344415fa69a3883b11f65db967b47

With the

-	double_spin_lock(&new_base->lock, &old_base->lock,
-			 smp_processor_id() < cpu);
+	spin_lock(&new_base->lock);
+	spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);


What's the reason that this is possible?  Is it because the migration
happens only on CPU hotplugging and that the CPU hotplugging code has
locks that would prevent a reversal of the lock taking?

I'm not arguing that the code is incorrect, but this looks like a subtlety
that can bite us later.

In other words, we really need comments around this code to explain to
casual viewers why this code is not deadlock prone. The change log here
and for 0d180406f2914aea3a78ddb880e2fe9ac78a9372 does not explain why the
straight forward taking of the locks is OK.

Thanks,

-- Steve

             reply	other threads:[~2008-06-25 19:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 19:46 Steven Rostedt [this message]
2008-06-26 11:06 ` Oleg Nesterov

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=Pine.LNX.4.58.0806251539180.405@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=tglx@linutronix.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

all inboxes | Powered by JetHome®