From: Arjan van de Ven <arjan@infradead.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Jonathan Corbet <corbet@lwn.net>, John Kacur <jkacur@redhat.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Frederic Weisbecker <fweisbec@gmail.com>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Vincent^M^J Sanders <vince@simtec.co.uk>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] sound_core.c: Remove BKL from soundcore_open
Date: Sun, 11 Oct 2009 10:37:55 -0700 [thread overview]
Message-ID: <20091011103755.649f5ae1@infradead.org> (raw)
In-Reply-To: <20091011111543.1cbb9a0e@tpl.lwn.net>
On Sun, 11 Oct 2009 11:15:43 -0600
Jonathan Corbet <corbet@lwn.net> wrote:
> On Sun, 11 Oct 2009 09:20:15 -0600
> Jonathan Corbet <corbet@lwn.net> wrote:
>
> > Changing the
> > BKL to a mutex is a real semantic change which requires a real
> > survey of the code affected.
>
> One other aspect of this I forgot to mention...it's actually possible
> (if unlikely) that one of those lower-level open routines depends on
> the BKL's release-on-sleep semantics. Swapping in a mutex would
> change that behavior, possibly resulting in deadlocks.
>
> I think it was Alan who once pointed out that the BKL is badly
> misnamed. It isn't really a lock, it's a modified execution
> environment designed to let naive kernel code think it's still running
> in a uniprocessor, no-preemption situation. Replacing the BKL with a
> different lock changes that environment, so one has to be *really*
> careful about looking for any assumptions which may remain in the
> code.
>
it's getting time though to bite the bullet and make it a real normal
mutex. Lockdep will then flag a bunch of sh*t we'll need to fix, but
without doing that we're never going to really make progress.
The BKL has outlived its usefulness. Many of the things it used to
protect (device open, module load etc) no longer take the BKL since
quite a while, making the notion of "if you see the BKL you have a bug"
more and more true.
Going from rather obscure semantics to more defined, and more
importantly, checkable-by-lockdep semantics is going to be a step
forward in this sense; while we can't check that it protects what it
should, we can at least start treating it like a real lock...
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2009-10-11 17:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-10 23:24 [PATCH] sound_core.c: Remove BKL from soundcore_open John Kacur
2009-10-10 23:42 ` Alan Cox
2009-10-11 0:25 ` John Kacur
2009-10-11 11:33 ` Frederic Weisbecker
2009-10-11 12:41 ` John Kacur
2009-10-11 14:12 ` Oliver Neukum
2009-10-11 20:40 ` Frederic Weisbecker
2009-10-11 21:25 ` John Kacur
2009-10-12 6:05 ` Takashi Iwai
2009-10-12 8:37 ` John Kacur
2009-10-12 10:17 ` Takashi Iwai
2009-10-12 10:42 ` John Kacur
2009-10-11 15:20 ` Jonathan Corbet
2009-10-11 17:15 ` Jonathan Corbet
2009-10-11 17:37 ` Arjan van de Ven [this message]
2009-10-11 19:17 ` Alan Cox
2009-10-11 19:26 ` Arjan van de Ven
2009-10-11 20:51 ` Alan Cox
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=20091011103755.649f5ae1@infradead.org \
--to=arjan@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=corbet@lwn.net \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vince@simtec.co.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