lkml.org 
[lkml]   [2010]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] preempt: fix kernel build with !CONFIG_BKL
Date
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


\
 
 \ /
  Last update: 2010-10-28 16:15    [from the cache]
©2003-2011 Jasper Spaans