From: Linus Torvalds <torvalds@linux-foundation.org>
To: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Rusty Russell <rusty@rustcorp.com.au>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
Nathan Lynch <nathanl@austin.ibm.com>,
Joel Schopp <jschopp@austin.ibm.com>,
Ashok Raj <ashok.raj@intel.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Gautham R Shenoy <ego@in.ibm.com>,
akpm@linux-foundation.org, Dipankar <dipankar@in.ibm.com>
Subject: Re: CPU hotplug: system hang on CPU hot remove during `pfmon --system-wide'
Date: Wed, 30 May 2007 10:03:01 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.98.0705301000350.26602@woody.linux-foundation.org> (raw)
In-Reply-To: <20070530165557.GB1626@in.ibm.com>
On Wed, 30 May 2007, Srivatsa Vaddagiri wrote:
>
> and that's where all the problems started - sleepers needing to take that mutex
> recursively (which we did/do not support).
>
> foo() takes cpu_bitmask_lock and calls
> foo_bar() which also needs cpu_bitmask_lock
>
> What is a solution to that?
The solution is to not have crap locking in the first place.
Or, if you absolutely have to, support recursive locking. But the bassic
rule should always really be that the need for recursive locking is really
a sign of a locking bug in the first place.
So what's so wrong with just admitting that the locking was crap, and
doing it properly? The _proper_ locking doesn't need recursive locks, it
just takes the lock at the outer layers, and then does *not* take it
internally, because the called routines are called with the lock held and
know they are safe.
We have been able to do that in _every_ single kernel subsystem. What's so
special about cpufreq? NOTHING. Except that the code is sometimes horribly
bad.
Linus
next prev parent reply other threads:[~2007-05-30 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-28 1:54 Satoru Takeuchi
2007-05-28 6:55 ` Srivatsa Vaddagiri
2007-05-29 20:56 ` Linus Torvalds
2007-05-30 2:42 ` Rusty Russell
2007-05-30 16:55 ` Srivatsa Vaddagiri
2007-05-30 17:03 ` Linus Torvalds [this message]
2007-05-31 16:51 ` Srivatsa Vaddagiri
2007-06-06 15:24 ` Gautham R Shenoy
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=alpine.LFD.0.98.0705301000350.26602@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=ashok.raj@intel.com \
--cc=dipankar@in.ibm.com \
--cc=ego@in.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathanl@austin.ibm.com \
--cc=rusty@rustcorp.com.au \
--cc=takeuchi_satoru@jp.fujitsu.com \
--cc=vatsa@in.ibm.com \
--cc=zwane@arm.linux.org.uk \
/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®