lkml.org 
[lkml]   [2021]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 04/19] sched: Prepare for Core-wide rq->lock
Hi Peter,

> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -186,12 +186,37 @@ int sysctl_sched_rt_runtime = 950000;
>
> void raw_spin_rq_lock_nested(struct rq *rq, int subclass)
> {
> - raw_spin_lock_nested(rq_lockp(rq), subclass);
> + raw_spinlock_t *lock;
> +
> + if (sched_core_disabled()) {

Nothing to stop sched_core from being enabled right here? Leading to
us potentially taking the wrong lock.

> + raw_spin_lock_nested(&rq->__lock, subclass);
> + return;
> + }
> +
> + for (;;) {
> + lock = rq_lockp(rq);
> + raw_spin_lock_nested(lock, subclass);
> + if (likely(lock == rq_lockp(rq)))
> + return;
> + raw_spin_unlock(lock);
> + }
> }

\
 
 \ /
  Last update: 2021-04-24 03:25    [W:0.370 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site