Skip to content

Commit

Permalink
preempt: Adjust PREEMPT_LOCK_OFFSET for RT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Aug 17, 2021
1 parent 51711e8 commit 015680a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/preempt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 015680a

Please sign in to comment.