All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: BKL: remove extraneous #include <smp_lock.h>
Date: Wed, 17 Nov 2010 23:43:07 +0100	[thread overview]
Message-ID: <201011172343.07949.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTimO6CN9wOQco_1bqRmwBS7KfWW1CvumKFuiOWGH@mail.gmail.com>

On Wednesday 17 November 2010 23:23:23 Linus Torvalds wrote:
> On Wed, Nov 17, 2010 at 2:05 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
> Hmm. I think that part was a mistake, but I suspect the simplest fix
> for it is to simply get rid of "kernel_locked()". It has no other
> users than the hardirq.h one, so let's just move it there.
> 
> Something like the attached?
> 
> NOTE! The reason I only take the CONFIG_LOCK_KERNEL version from
> smp_lock.h is because:
> 
>  - LOCK_KERNEL is defined by init/Kconfig as "(SMP || PREEMPT) && BKL"
> 
>  - inside hardirq.h we only use "kernel_locked()" inside "PREEMPT && BKL"
> 
>  - so "PREEMPT && BKL" implies "LOCK_KERNEL"
> 
>  - so the !LOCK_KERNEL kernel_locked() case is irrelevant.
> 
> unless I did a thinko somewhere.
> 
> Does this work in all configurations? TOTALLY UNTESTED! Caveat emptor.

It looks completely right, thanks for diving into the problem yourself!

The script that I used to create the broken patch removed the smp_lock.h
include from all files that did not call any of lock_kernel, unlock_lernel,
release_kernel_lock and reacquire_kernel_lock, but I missed kernel_locked().

I did not find it in my own build tests, I only tested PREEMPT with BKL
disabled and vice versa and the mails about the build failure in -next
reached me after you had already pulled the patch.

	Arnd

  parent reply	other threads:[~2010-11-17 22:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201011172159.oAHLx1tu001236@hera.kernel.org>
2010-11-17 22:05 ` BKL: remove extraneous #include <smp_lock.h> Randy Dunlap
2010-11-17 22:23   ` Linus Torvalds
2010-11-17 22:37     ` Randy Dunlap
2010-11-17 22:43     ` Arnd Bergmann [this message]
2010-11-18  9:43     ` [build failure] " Ingo Molnar
2010-11-18 15:57       ` Linus Torvalds
2010-11-18 16:02         ` Linus Torvalds
2010-11-18 16:28           ` Randy Dunlap
2010-11-18 19:02           ` Ingo Molnar
2010-11-18 19:04             ` Randy Dunlap
2010-11-18 19:44             ` Linus Torvalds
2010-11-18 19:51             ` Ingo Molnar

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=201011172343.07949.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.