preempt: Move PREEMPT_NEED_RESCHED definition into arch code
authorWill Deacon <will.deacon@arm.com>
Wed, 19 Sep 2018 12:39:26 +0000 (13:39 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 7 Dec 2018 12:35:46 +0000 (12:35 +0000)
PREEMPT_NEED_RESCHED is never used directly, so move it into the arch
code where it can potentially be implemented using either a different
bit in the preempt count or as an entirely separate entity.

Cc: Robert Love <rml@tech9.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/s390/include/asm/preempt.h
arch/x86/include/asm/preempt.h
include/linux/preempt.h

index 23a14d187fb1ba72b294ac3cd21aae49f69200dc..b5ea9e14c017aae1966d08871cb7e2a43001849e 100644 (file)
@@ -8,6 +8,8 @@
 
 #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
 
+/* We use the MSB mostly because its available */
+#define PREEMPT_NEED_RESCHED   0x80000000
 #define PREEMPT_ENABLED        (0 + PREEMPT_NEED_RESCHED)
 
 static inline int preempt_count(void)
index 90cb2f36c042fec25dc765b4241d68ccb48a3eba..99a7fa9ab0a32a1c24e4b699aa3ad10b4640b9f5 100644 (file)
@@ -8,6 +8,9 @@
 
 DECLARE_PER_CPU(int, __preempt_count);
 
+/* We use the MSB mostly because its available */
+#define PREEMPT_NEED_RESCHED   0x80000000
+
 /*
  * We use the PREEMPT_NEED_RESCHED bit as an inverted NEED_RESCHED such
  * that a decrement hitting 0 means we can and should reschedule.
index c01813c3fbe9336ed69a54a0296ed7bb69186a5f..dd92b1a93919fd26af81eb1f0cb43dae5f5efd2d 100644 (file)
@@ -53,9 +53,6 @@
 
 #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
 
-/* We use the MSB mostly because its available */
-#define PREEMPT_NEED_RESCHED   0x80000000
-
 #define PREEMPT_DISABLED       (PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED)
 
 /*