From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Alexander Viro <viro@ftp.linux.org.uk>
Subject: Re: [announce] "kill the Big Kernel Lock (BKL)" tree
Date: Thu, 15 May 2008 10:41:54 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0805151020460.3019@woody.linux-foundation.org> (raw)
In-Reply-To: <20080514174955.GA515@elte.hu>
So looking a bit more at your trivial fixups, I'd suggest strongly that
they be re-organized a bit.
I cherry-picked your tty layer thing, because it was a real fix.
On Wed, 14 May 2008, Ingo Molnar wrote:
>
> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
> index 6eab9bf..e12e571 100644
> --- a/net/sunrpc/sched.c
> +++ b/net/sunrpc/sched.c
> @@ -224,9 +224,15 @@ EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue);
>
> static int rpc_wait_bit_killable(void *word)
> {
> + int bkl = kernel_locked();
> +
> if (fatal_signal_pending(current))
> return -ERESTARTSYS;
> + if (bkl)
> + unlock_kernel();
> schedule();
> + if (bkl)
> + lock_kernel();
> return 0;
> }
The above doesn't even work in general. It depends on having just a single
level of locking, and is ugly to boot. So wow about we just expose some
version of
depth = release_kernel_lock()
..
reacquire_kernel_lock(depth);
to existing BKL users as a way to safely release and re-aquire it
regardless of depth. That makes the code more generic, but it *also* makes
it more readable than that "if (bkl) [un]lock_kernel()" sequence.
> commit 89c25297465376321cf54438d86441a5947bbd11
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 15:10:37 2008 +0200
>
> remove the BKL: do not take the BKL in init code
I think this one should be changed - that comment says "do not take", but
in fact you still do take it, you just release it earlier. So we should
just not start out with the kernel locked in the first place. The BKL
doesn't do anything for the init sequence anyway, since all of this is for
code that runs before there even are any other threads (not counting the
idle thread).
I don't see anything in there that could *possibly* depend on the kernel
lock, and if there is anything, it would need to be fixed anyway.
> commit 5fff2843de609b77d4590e87de5c976b8ac1aacd
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 14:30:33 2008 +0200
>
> remove the BKL: procfs debug helper and BKL elimination
ACK. Code that relies on this is broken anyway.
We used to have lots of "proc_create()" followed by setup code that could
race with "proc_lookup()", but they were fundamentally racy anyway, so
this should happen regardless of any other BKL removal.
> commit b07e615cf0f731d53a3ab431f44b1fe6ef4576e6
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 14:19:52 2008 +0200
>
> remove the BKL: request_module() debug helper
See the above comment about "release/reaquire_kernel_lock()".
> commit d31eec64e76a4b0795b5a6b57f2925d57aeefda5
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 13:47:58 2008 +0200
>
> remove the BKL: tty updates
Same thing.
> commit 3a0bf25bb160233b902962457ce917df27550850
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 11:34:13 2008 +0200
>
> remove the BKL: reduce misc_open() BKL dependency
Same thing.
> commit 79b2b296c31fa07e8868a6c622d766bb567f6655
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 11:30:35 2008 +0200
>
> remove the BKL: change get_fs_type() BKL dependency
Same thing.
> commit fc6f051a95c8774abb950f287b4b5e7f710f6977
> Author: Ingo Molnar <mingo@elte.hu>
> Date: Wed May 14 09:51:42 2008 +0200
>
> revert ("BKL: revert back to the old spinlock implementation")
And obviously this one I'd never take. It would need to work with a
working BKL implementation.
Linus
next prev parent reply other threads:[~2008-05-15 17:42 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-14 17:49 Ingo Molnar
2008-05-14 18:30 ` Andi Kleen
2008-05-14 21:00 ` Alan Cox
2008-05-14 21:13 ` Andi Kleen
2008-05-14 21:16 ` H. Peter Anvin
2008-05-14 21:17 ` Alan Cox
2008-05-14 21:19 ` Alan Cox
2008-05-14 21:45 ` Linus Torvalds
2008-05-14 22:03 ` Andi Kleen
2008-05-15 13:34 ` Alan Cox
2008-05-15 14:27 ` Andi Kleen
2008-05-15 15:36 ` Alan Cox
2008-05-16 10:21 ` Andi Kleen
2008-05-15 8:02 ` Ingo Molnar
2008-05-14 18:41 ` Linus Torvalds
2008-05-14 19:41 ` Ingo Molnar
2008-05-14 20:05 ` Frederik Deweerdt
2008-05-14 21:45 ` Jonathan Corbet
2008-05-14 21:39 ` Alan Cox
2008-05-14 21:56 ` Linus Torvalds
2008-05-14 22:07 ` Jonathan Corbet
2008-05-14 22:14 ` Linus Torvalds
2008-05-22 20:20 ` Alan Cox
2008-05-16 15:44 ` [PATCH, RFC] char dev BKL pushdown Jonathan Corbet
2008-05-16 15:49 ` Christoph Hellwig
2008-05-16 16:03 ` [PATCH] kill empty chardev open/release methods Christoph Hellwig
2008-05-16 16:24 ` Alan Cox
2008-05-16 20:55 ` Alan Cox
2008-05-18 19:46 ` Jonathan Corbet
2008-05-18 19:58 ` Alan Cox
2008-05-16 16:22 ` [PATCH, RFC] char dev BKL pushdown Alan Cox
2008-05-16 16:30 ` Linus Torvalds
2008-05-16 16:43 ` Jonathan Corbet
2008-05-17 21:15 ` Arnd Bergmann
2008-05-18 20:26 ` Jonathan Corbet
2008-05-19 23:07 ` Arnd Bergmann
[not found] ` <200805200111.47275.arnd@arndb.de>
2008-05-19 23:14 ` [PATCH 2/3, RFC] watchdog " Arnd Bergmann
2008-05-20 6:20 ` Christoph Hellwig
2008-05-20 8:30 ` Arnd Bergmann
2008-05-20 15:47 ` Wim Van Sebroeck
2008-05-20 18:31 ` Alan Cox
2008-05-20 21:00 ` Arnd Bergmann
2008-05-22 9:34 ` Alan Cox
2008-05-20 9:08 ` Alan Cox
2008-05-20 8:42 ` Alan Cox
2008-05-19 23:26 ` [PATCH 1/3, RFC] misc char " Arnd Bergmann
2008-05-20 0:07 ` Mike Frysinger
2008-05-20 0:21 ` Jonathan Corbet
2008-05-20 0:46 ` Mike Frysinger
2008-05-20 8:46 ` Alan Cox
2008-05-20 23:01 ` Mike Frysinger
2008-05-20 23:25 ` Jonathan Corbet
2008-05-21 16:22 ` Mike Frysinger
2008-05-19 23:34 ` [PATCH 3/3, RFC] remove BKL from misc_open() Arnd Bergmann
2008-05-20 15:13 ` [PATCH, RFC] char dev BKL pushdown Jonathan Corbet
2008-05-20 17:21 ` Arnd Bergmann
2008-05-20 18:51 ` Alan Cox
2008-05-17 21:58 ` Linus Torvalds
2008-05-18 20:07 ` Jonathan Corbet
2008-05-14 22:11 ` [announce] "kill the Big Kernel Lock (BKL)" tree Andi Kleen
2008-05-14 22:16 ` Linus Torvalds
2008-05-14 22:21 ` Andi Kleen
2008-05-15 13:30 ` Alan Cox
2008-05-15 15:05 ` John Stoffel
2008-05-15 15:10 ` Andi Kleen
2008-05-15 15:18 ` John Stoffel
2008-05-15 15:45 ` Andi Kleen
2008-05-15 8:44 ` Jan Engelhardt
2008-05-15 14:54 ` Diego Calleja
2008-05-14 21:46 ` Alan Cox
2008-05-14 22:11 ` Linus Torvalds
2008-05-14 22:15 ` Andi Kleen
2008-05-15 17:41 ` Linus Torvalds [this message]
2008-05-15 20:27 ` Arjan van de Ven
2008-05-15 20:45 ` Peter Zijlstra
2008-05-15 21:22 ` Arjan van de Ven
2008-05-17 0:14 ` Kevin Winchester
2008-05-17 0:37 ` Kevin Winchester
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.1.10.0805151020460.3019@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=viro@ftp.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®