Skip to content

Commit 015680a

Browse files
KAGA-KOKOingomolnar
authored andcommitted
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
1 parent 51711e8 commit 015680a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/linux/preempt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@
121121
/*
122122
* The preempt_count offset after spin_lock()
123123
*/
124+
#if !defined(CONFIG_PREEMPT_RT)
124125
#define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET
126+
#else
127+
#define PREEMPT_LOCK_OFFSET 0
128+
#endif
125129

126130
/*
127131
* The preempt_count offset needed for things like:

0 commit comments

Comments
 (0)