]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Avoid double preemption in __cond_resched_*lock*()
authorPeter Zijlstra <peterz@infradead.org>
Sat, 25 Dec 2021 00:04:57 +0000 (01:04 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 18 Jan 2022 11:09:59 +0000 (12:09 +0100)
commit4c98f048d1bad0626505a141a9181a8abe3be4d8
treebe7b54af0c125126592596a0a37b95bb3d875355
parentc135802fbd2ea142bcc4c34f8ee3720362c8456a
sched: Avoid double preemption in __cond_resched_*lock*()

For PREEMPT/DYNAMIC_PREEMPT the *_unlock() will already trigger a
preemption, no point in then calling preempt_schedule_common()
*again*.

Use _cond_resched() instead, since this is a NOP for the preemptible
configs while it provide a preemption point for the others.

Reported-by: xuhaifeng <xuhaifeng@oppo.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/YcGnvDEYBwOiV0cR@hirez.programming.kicks-ass.net
kernel/sched/core.c