aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/preempt.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-08-15 23:29:22 +0200
committerIngo Molnar <mingo@kernel.org>2021-08-17 19:06:04 +0200
commit015680aa4c5d784513d0a9728bc52ec7c4a64227 (patch)
tree6f5b9ad1845d01293a6780e7fcfef57487a7d3ab /include/linux/preempt.h
parentlocking/rtmutex: Prevent lockdep false positive with PI futexes (diff)
downloadwireguard-linux-015680aa4c5d784513d0a9728bc52ec7c4a64227.tar.xz
wireguard-linux-015680aa4c5d784513d0a9728bc52ec7c4a64227.zip
preempt: Adjust PREEMPT_LOCK_OFFSET for RT
On PREEMPT_RT regular spinlocks and rwlocks are substituted with rtmutex based constructs. spin/rwlock held regions are preemptible on PREEMPT_RT, so PREEMPT_LOCK_OFFSET has to be 0 to make the various cond_resched_*lock() functions work correctly. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210815211305.804246275@linutronix.de
Diffstat (limited to 'include/linux/preempt.h')
-rw-r--r--include/linux/preempt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 9881eac0698f..4d244e295e85 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -121,7 +121,11 @@
/*
* The preempt_count offset after spin_lock()
*/
+#if !defined(CONFIG_PREEMPT_RT)
#define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET
+#else
+#define PREEMPT_LOCK_OFFSET 0
+#endif
/*
* The preempt_count offset needed for things like: