]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Make cond_resched_*lock() variants consistent vs. might_sleep()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 23 Sep 2021 16:54:37 +0000 (18:54 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 1 Oct 2021 11:57:50 +0000 (13:57 +0200)
commit8162efe602ca3ad75110c6f79ff7ae32b9c3a2e8
tree9b7c013500409b5e0292b6fd2a6eb8ed8447fd5c
parent061278dc2d7d0d731e1788cc85b868c5d7a11b0a
sched: Make cond_resched_*lock() variants consistent vs. might_sleep()

Commit a4b7e55b06f3 ("sched: Exclude cond_resched() from nested sleep
test") removed the task state check of __might_sleep() for
cond_resched_lock() because cond_resched_lock() is not a voluntary
scheduling point which blocks. It's a preemption point which requires the
lock holder to release the spin lock.

The same rationale applies to cond_resched_rwlock_read/write(), but those
were not touched.

Make it consistent and use the non-state checking __might_resched() there
as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210923165357.991262778@linutronix.de
include/linux/sched.h