public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 v2] preempt: fix kernel build with !CONFIG_BKL
Date: Thu, 28 Oct 2010 16:12:33 +0200	[thread overview]
Message-ID: <201010281612.33732.arnd@arndb.de> (raw)
In-Reply-To: <20101028134658.GA17769@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 Shutemov <kirill@shutemov.name>
---
> On Thursday 28 October 2010, Kirill A. Shutemov wrote:
> On Thu, Oct 28, 2010 at 01:20:44PM +0200, Arnd Bergmann wrote:
> > 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>
> 
> Remove quotes, please.

That would make it an invalid email address because of the dot. I left out
the middle initial now, if that's better.

> I've got a lot of __schedule_bug. Log attached.

Ok. I really don't understand the preempt code all that well, let's
hope that this one is right.

Thanks for your patience and for your testing!

	Arnd

diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 8a389b6..41cb31f 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -96,11 +96,15 @@
  */
 #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
 # define PREEMPT_INATOMIC_BASE 0
+#endif
+
+#if defined(CONFIG_PREEMPT)
+# define PREEMPT_CHECK_OFFSET 1
+#else
 # define PREEMPT_CHECK_OFFSET 0
 #endif
 

  reply	other threads:[~2010-10-28 14:12 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 ` [PATCH] preempt: fix kernel build with !CONFIG_BKL Arnd Bergmann
2010-10-28 13:46   ` Kirill A. Shutemov
2010-10-28 14:12     ` Arnd Bergmann [this message]
2010-10-28 19:47       ` [PATCH v2] " 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=201010281612.33732.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox