From: Arnd Bergmann <arnd@arndb.de>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: linux-kernel@vger.kernel.org, Avi Kivity <avi@redhat.com>,
Brian Gerst <brgerst@gmail.com>,
David Howells <dhowells@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Pekka Enberg <penberg@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Suresh Siddha <suresh.b.siddha@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Venkatesh Pallipadi <venki@google.com>,
x86@kernel.org
Subject: [PATCH] preempt: fix kernel build with !CONFIG_BKL
Date: Thu, 28 Oct 2010 13:20:44 +0200 [thread overview]
Message-ID: <201010281320.44765.arnd@arndb.de> (raw)
In-Reply-To: <20101028095910.GA15970@shutemov.name>
The preempt count logic tries to take the BKL into account, which breaks
when CONFIG_BKL is not set.
Use the same preempt_count offset that we use without CONFIG_PREEMPT
when CONFIG_BKL is disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: "Kirill A. Shutemov" <kirill@shutemov.name>
---
> /home/kas/git/tmp/linux-2.6-local/arch/x86/include/asm/i387.h: In function ‘irq_ts_save’:
> /home/kas/git/tmp/linux-2.6-local/arch/x86/include/asm/i387.h:324: error: implicit declaration of function ‘kernel_locked’
> make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
> make: *** [prepare0] Error 2
Ah, found it. I had not considered or tested the case of CONFIG_BKL=n
with CONFIG_PREEMPT=y.
Does this work? Ideally please test with LOCKDEP enabled to see if
there are other problems in this configuration that I missed.
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -96,7 +96,7 @@
*/
#define in_nmi() (preempt_count() & NMI_MASK)
-#if defined(CONFIG_PREEMPT)
+#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
# define PREEMPT_INATOMIC_BASE kernel_locked()
# define PREEMPT_CHECK_OFFSET 1
#else
next prev parent reply other threads:[~2010-10-28 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 9:59 i387.h:324: error: implicit declaration of function ‘kernel_locked’ Kirill A. Shutemov
2010-10-28 11:20 ` Arnd Bergmann [this message]
2010-10-28 13:46 ` [PATCH] preempt: fix kernel build with !CONFIG_BKL Kirill A. Shutemov
2010-10-28 14:12 ` [PATCH v2] " Arnd Bergmann
2010-10-28 19:47 ` Kirill A. Shutemov
2010-10-28 21:08 ` Arnd Bergmann
2010-10-28 22:25 ` H. Peter Anvin
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=201010281320.44765.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=a.p.zijlstra@chello.nl \
--cc=avi@redhat.com \
--cc=brgerst@gmail.com \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=penberg@kernel.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=venki@google.com \
--cc=x86@kernel.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.