mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
sched: Make RCU nest depth distinct in __might_resched()
For !RT kernels RCU nest depth in __might_resched() is always expected to be 0, but on RT kernels it can be non zero while the preempt count is expected to be always 0. Instead of playing magic games in interpreting the 'preempt_offset' argument, rename it to 'offsets' and use the lower 8 bits for the expected preempt count, allow to hand in the expected RCU nest depth in the upper bits and adopt the __might_resched() code and related checks and printks. The affected call sites are updated in subsequent steps. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20210923165358.243232823@linutronix.de
This commit is contained in:
committed by
Peter Zijlstra
parent
8d713b699e
commit
50e081b96e
@@ -2046,6 +2046,9 @@ extern int __cond_resched_lock(spinlock_t *lock);
|
||||
extern int __cond_resched_rwlock_read(rwlock_t *lock);
|
||||
extern int __cond_resched_rwlock_write(rwlock_t *lock);
|
||||
|
||||
#define MIGHT_RESCHED_RCU_SHIFT 8
|
||||
#define MIGHT_RESCHED_PREEMPT_MASK ((1U << MIGHT_RESCHED_RCU_SHIFT) - 1)
|
||||
|
||||
#define cond_resched_lock(lock) ({ \
|
||||
__might_resched(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
|
||||
__cond_resched_lock(lock); \
|
||||
|
Reference in New Issue
Block a user