-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sched: Make cond_resched_lock() RT aware
[ This is an all-in-one commit reverting the commit sched: Do not account rcu_preempt_depth on RT in might_sleep() and introducing this commit. ] The might_sleep() checks in the cond_resched_lock() variants use PREEMPT_LOCK_OFFSET for preempt count offset checking. On PREEMPT_RT enabled kernels spin/rw_lock held sections stay preemptible which means PREEMPT_LOCK_OFFSET is 0, but that still triggers the might_sleep() check because that takes RCU read side nesting into account. On RT enabled kernels spin/read/write_lock() issue rcu_read_lock() to resemble the !RT semantics, which means in cond_resched_lock() the might sleep check will see preempt_count() == 0 and rcu_preempt_depth() == 1. Introduce PREEMPT_LOCK_SCHED_OFFSET for those might sleep checks and map them to PREEMPT_LOCK_OFFSET on !RT and to 1 (accounting for rcu_preempt_depth()) on RT enabled kernels. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- Loading branch information
Thomas Gleixner
authored and
Sebastian Andrzej Siewior
committed
Sep 22, 2021
1 parent
279b703
commit c56c6f2
Showing
4 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters