]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/preempt.h
sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()
[karo-tx-linux.git] / arch / x86 / include / asm / preempt.h
index dca71714f86076f5fae6508fe6bbcb2c573723ae..b12f81022a6b2c574f9c037e616f90373502c24e 100644 (file)
@@ -90,9 +90,9 @@ static __always_inline bool __preempt_count_dec_and_test(void)
 /*
  * Returns true when we need to resched and can (barring IRQ state).
  */
-static __always_inline bool should_resched(void)
+static __always_inline bool should_resched(int preempt_offset)
 {
-       return unlikely(!raw_cpu_read_4(__preempt_count));
+       return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset);
 }
 
 #ifdef CONFIG_PREEMPT