Skip to content

Commit 95158a8

Browse files
author
Peter Zijlstra
committed
sched,rt: Use the full cpumask for balancing
We want migrate_disable() tasks to get PULLs in order for them to PUSH away the higher priority task. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Valentin Schneider <valentin.schneider@arm.com> Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> Link: https://lkml.kernel.org/r/20201023102347.310519774@infradead.org
1 parent 14e292f commit 95158a8

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎kernel/sched/cpudeadline.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
120120
const struct sched_dl_entity *dl_se = &p->dl;
121121

122122
if (later_mask &&
123-
cpumask_and(later_mask, cp->free_cpus, p->cpus_ptr)) {
123+
cpumask_and(later_mask, cp->free_cpus, &p->cpus_mask)) {
124124
unsigned long cap, max_cap = 0;
125125
int cpu, max_cpu = -1;
126126

@@ -151,7 +151,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
151151

152152
WARN_ON(best_cpu != -1 && !cpu_present(best_cpu));
153153

154-
if (cpumask_test_cpu(best_cpu, p->cpus_ptr) &&
154+
if (cpumask_test_cpu(best_cpu, &p->cpus_mask) &&
155155
dl_time_before(dl_se->deadline, cp->elements[0].dl)) {
156156
if (later_mask)
157157
cpumask_set_cpu(best_cpu, later_mask);

‎kernel/sched/cpupri.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ static inline int __cpupri_find(struct cpupri *cp, struct task_struct *p,
7373
if (skip)
7474
return 0;
7575

76-
if (cpumask_any_and(p->cpus_ptr, vec->mask) >= nr_cpu_ids)
76+
if (cpumask_any_and(&p->cpus_mask, vec->mask) >= nr_cpu_ids)
7777
return 0;
7878

7979
if (lowest_mask) {
80-
cpumask_and(lowest_mask, p->cpus_ptr, vec->mask);
80+
cpumask_and(lowest_mask, &p->cpus_mask, vec->mask);
8181

8282
/*
8383
* We have to ensure that we have at least one bit

‎kernel/sched/deadline.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ static void task_fork_dl(struct task_struct *p)
19121912
static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu)
19131913
{
19141914
if (!task_running(rq, p) &&
1915-
cpumask_test_cpu(cpu, p->cpus_ptr))
1915+
cpumask_test_cpu(cpu, &p->cpus_mask))
19161916
return 1;
19171917
return 0;
19181918
}
@@ -2062,7 +2062,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
20622062
/* Retry if something changed. */
20632063
if (double_lock_balance(rq, later_rq)) {
20642064
if (unlikely(task_rq(task) != rq ||
2065-
!cpumask_test_cpu(later_rq->cpu, task->cpus_ptr) ||
2065+
!cpumask_test_cpu(later_rq->cpu, &task->cpus_mask) ||
20662066
task_running(rq, task) ||
20672067
!dl_task(task) ||
20682068
!task_on_rq_queued(task))) {

‎kernel/sched/rt.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p)
16581658
static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu)
16591659
{
16601660
if (!task_running(rq, p) &&
1661-
cpumask_test_cpu(cpu, p->cpus_ptr))
1661+
cpumask_test_cpu(cpu, &p->cpus_mask))
16621662
return 1;
16631663

16641664
return 0;
@@ -1811,7 +1811,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)
18111811
* Also make sure that it wasn't scheduled on its rq.
18121812
*/
18131813
if (unlikely(task_rq(task) != rq ||
1814-
!cpumask_test_cpu(lowest_rq->cpu, task->cpus_ptr) ||
1814+
!cpumask_test_cpu(lowest_rq->cpu, &task->cpus_mask) ||
18151815
task_running(rq, task) ||
18161816
!rt_task(task) ||
18171817
!task_on_rq_queued(task))) {

0 commit comments

Comments
 (0)