diff options
| -rw-r--r-- | kernel/sched/fair.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e6f7d39d4d45..f0d2f8a352bf 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -8059,6 +8059,18 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) | |||
| 8059 | } | 8059 | } |
| 8060 | 8060 | ||
| 8061 | /* | 8061 | /* |
| 8062 | * Check whether a rq has a misfit task and if it looks like we can actually | ||
| 8063 | * help that task: we can migrate the task to a CPU of higher capacity, or | ||
| 8064 | * the task's current CPU is heavily pressured. | ||
| 8065 | */ | ||
| 8066 | static inline int check_misfit_status(struct rq *rq, struct sched_domain *sd) | ||
| 8067 | { | ||
| 8068 | return rq->misfit_task_load && | ||
| 8069 | (rq->cpu_capacity_orig < rq->rd->max_cpu_capacity || | ||
| 8070 | check_cpu_capacity(rq, sd)); | ||
| 8071 | } | ||
| 8072 | |||
| 8073 | /* | ||
| 8062 | * Group imbalance indicates (and tries to solve) the problem where balancing | 8074 | * Group imbalance indicates (and tries to solve) the problem where balancing |
| 8063 | * groups is inadequate due to ->cpus_allowed constraints. | 8075 | * groups is inadequate due to ->cpus_allowed constraints. |
| 8064 | * | 8076 | * |
| @@ -9585,7 +9597,7 @@ static void nohz_balancer_kick(struct rq *rq) | |||
| 9585 | if (time_before(now, nohz.next_balance)) | 9597 | if (time_before(now, nohz.next_balance)) |
| 9586 | goto out; | 9598 | goto out; |
| 9587 | 9599 | ||
| 9588 | if (rq->nr_running >= 2 || rq->misfit_task_load) { | 9600 | if (rq->nr_running >= 2) { |
| 9589 | flags = NOHZ_KICK_MASK; | 9601 | flags = NOHZ_KICK_MASK; |
| 9590 | goto out; | 9602 | goto out; |
| 9591 | } | 9603 | } |
| @@ -9623,6 +9635,18 @@ static void nohz_balancer_kick(struct rq *rq) | |||
| 9623 | } | 9635 | } |
| 9624 | } | 9636 | } |
| 9625 | 9637 | ||
| 9638 | sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, cpu)); | ||
| 9639 | if (sd) { | ||
| 9640 | /* | ||
| 9641 | * When ASYM_CPUCAPACITY; see if there's a higher capacity CPU | ||
| 9642 | * to run the misfit task on. | ||
| 9643 | */ | ||
| 9644 | if (check_misfit_status(rq, sd)) { | ||
| 9645 | flags = NOHZ_KICK_MASK; | ||
| 9646 | goto unlock; | ||
| 9647 | } | ||
| 9648 | } | ||
| 9649 | |||
| 9626 | sd = rcu_dereference(per_cpu(sd_asym_packing, cpu)); | 9650 | sd = rcu_dereference(per_cpu(sd_asym_packing, cpu)); |
| 9627 | if (sd) { | 9651 | if (sd) { |
| 9628 | /* | 9652 | /* |
