public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: BKL: remove extraneous #include <smp_lock.h>
Date: Wed, 17 Nov 2010 14:37:35 -0800	[thread overview]
Message-ID: <4CE4592F.6060104@oracle.com> (raw)
In-Reply-To: <AANLkTimO6CN9wOQco_1bqRmwBS7KfWW1CvumKFuiOWGH@mail.gmail.com>

On 11/17/10 14:23, Linus Torvalds wrote:
> On Wed, Nov 17, 2010 at 2:05 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>> smp_lock.h was removed from hardirq.h.  smp_lock.h provided the function prototype
>> for kernel_locked().  Should source files now #include <linux/smp_lock.h> ?
>> even when not being built for SMP?
> 
> 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 goes from one use of kernel_locked in *.[ch] to no uses of kernel_locked(),
so yes, it works for me.  (I did one previously-failing build with this patch,
and it built with no errors.)

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2010-11-17 22:38 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 [this message]
2010-11-17 22:43     ` Arnd Bergmann
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=4CE4592F.6060104@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox