lkml.org 
[lkml]   [2019]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [tip:sched/core] sched/fair: Use rq_lock/unlock in online_fair_sched_group
From
Date
On 8/8/19 1:01 PM, tip-bot for Phil Auld wrote:

[...]

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 19c58599e967..d9407517dae9 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -10281,18 +10281,18 @@ err:
> void online_fair_sched_group(struct task_group *tg)
> {
> struct sched_entity *se;
> + struct rq_flags rf;
> struct rq *rq;
> int i;
>
> for_each_possible_cpu(i) {
> rq = cpu_rq(i);
> se = tg->se[i];
> -
> - raw_spin_lock_irq(&rq->lock);
> + rq_lock(rq, &rf);
> update_rq_clock(rq);
> attach_entity_cfs_rq(se);
> sync_throttle(tg, i);
> - raw_spin_unlock_irq(&rq->lock);
> + rq_unlock(rq, &rf);
> }
> }

Shouldn't this be:

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d9407517dae9..1054d2cf6aaa 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10288,11 +10288,11 @@ void online_fair_sched_group(struct task_group
*tg)
for_each_possible_cpu(i) {
rq = cpu_rq(i);
se = tg->se[i];
- rq_lock(rq, &rf);
+ rq_lock_irq(rq, &rf);
update_rq_clock(rq);
attach_entity_cfs_rq(se);
sync_throttle(tg, i);
- rq_unlock(rq, &rf);
+ rq_unlock_irq(rq, &rf);
}
}

Currently, you should get a 'inconsistent lock state' warning with
CONFIG_PROVE_LOCKING.
\
 
 \ /
  Last update: 2019-08-09 18:22    [W:0.142 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site