mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
locking: Make owner_on_cpu() into <linux/sched.h>
Move the owner_on_cpu() from kernel/locking/rwsem.c into include/linux/sched.h with under CONFIG_SMP, then use it in the mutex/rwsem/rtmutex to simplify the code. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20211203075935.136808-2-wangkefeng.wang@huawei.com
This commit is contained in:
committed by
Peter Zijlstra
parent
9a75bd0c52
commit
c0bed69daf
@@ -1382,9 +1382,8 @@ static bool rtmutex_spin_on_owner(struct rt_mutex_base *lock,
|
||||
* for CONFIG_PREEMPT_RCU=y)
|
||||
* - the VCPU on which owner runs is preempted
|
||||
*/
|
||||
if (!owner->on_cpu || need_resched() ||
|
||||
rt_mutex_waiter_is_top_waiter(lock, waiter) ||
|
||||
vcpu_is_preempted(task_cpu(owner))) {
|
||||
if (!owner_on_cpu(owner) || need_resched() ||
|
||||
rt_mutex_waiter_is_top_waiter(lock, waiter)) {
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user