Lines Matching refs:env
1623 static void update_numa_stats(struct task_numa_env *env, in update_numa_stats() argument
1644 !cpumask_test_cpu(cpu, env->p->cpus_ptr)) in update_numa_stats()
1657 ns->node_type = numa_classify(env->imbalance_pct, ns); in update_numa_stats()
1663 static void task_numa_assign(struct task_numa_env *env, in task_numa_assign() argument
1666 struct rq *rq = cpu_rq(env->dst_cpu); in task_numa_assign()
1669 if (env->best_cpu != env->dst_cpu && xchg(&rq->numa_migrate_on, 1)) { in task_numa_assign()
1671 int start = env->dst_cpu; in task_numa_assign()
1674 for_each_cpu_wrap(cpu, cpumask_of_node(env->dst_nid), start) { in task_numa_assign()
1675 if (cpu == env->best_cpu || !idle_cpu(cpu) || in task_numa_assign()
1676 !cpumask_test_cpu(cpu, env->p->cpus_ptr)) { in task_numa_assign()
1680 env->dst_cpu = cpu; in task_numa_assign()
1681 rq = cpu_rq(env->dst_cpu); in task_numa_assign()
1695 if (env->best_cpu != -1 && env->best_cpu != env->dst_cpu) { in task_numa_assign()
1696 rq = cpu_rq(env->best_cpu); in task_numa_assign()
1700 if (env->best_task) in task_numa_assign()
1701 put_task_struct(env->best_task); in task_numa_assign()
1705 env->best_task = p; in task_numa_assign()
1706 env->best_imp = imp; in task_numa_assign()
1707 env->best_cpu = env->dst_cpu; in task_numa_assign()
1711 struct task_numa_env *env) in load_too_imbalanced() argument
1724 src_capacity = env->src_stats.compute_capacity; in load_too_imbalanced()
1725 dst_capacity = env->dst_stats.compute_capacity; in load_too_imbalanced()
1729 orig_src_load = env->src_stats.load; in load_too_imbalanced()
1730 orig_dst_load = env->dst_stats.load; in load_too_imbalanced()
1751 static bool task_numa_compare(struct task_numa_env *env, in task_numa_compare() argument
1754 struct numa_group *cur_ng, *p_ng = deref_curr_numa_group(env->p); in task_numa_compare()
1755 struct rq *dst_rq = cpu_rq(env->dst_cpu); in task_numa_compare()
1759 int dist = env->dist; in task_numa_compare()
1776 if (cur == env->p) { in task_numa_compare()
1782 if (maymove && moveimp >= env->best_imp) in task_numa_compare()
1789 if (!cpumask_test_cpu(env->src_cpu, cur->cpus_ptr)) in task_numa_compare()
1796 if (env->best_task && in task_numa_compare()
1797 env->best_task->numa_preferred_nid == env->src_nid && in task_numa_compare()
1798 cur->numa_preferred_nid != env->src_nid) { in task_numa_compare()
1814 imp = taskimp + task_weight(cur, env->src_nid, dist) - in task_numa_compare()
1815 task_weight(cur, env->dst_nid, dist); in task_numa_compare()
1828 imp += group_weight(cur, env->src_nid, dist) - in task_numa_compare()
1829 group_weight(cur, env->dst_nid, dist); in task_numa_compare()
1831 imp += task_weight(cur, env->src_nid, dist) - in task_numa_compare()
1832 task_weight(cur, env->dst_nid, dist); in task_numa_compare()
1836 if (cur->numa_preferred_nid == env->dst_nid) in task_numa_compare()
1845 if (cur->numa_preferred_nid == env->src_nid) in task_numa_compare()
1848 if (maymove && moveimp > imp && moveimp > env->best_imp) { in task_numa_compare()
1858 if (env->best_task && cur->numa_preferred_nid == env->src_nid && in task_numa_compare()
1859 env->best_task->numa_preferred_nid != env->src_nid) { in task_numa_compare()
1869 if (imp < SMALLIMP || imp <= env->best_imp + SMALLIMP / 2) in task_numa_compare()
1875 load = task_h_load(env->p) - task_h_load(cur); in task_numa_compare()
1879 dst_load = env->dst_stats.load + load; in task_numa_compare()
1880 src_load = env->src_stats.load - load; in task_numa_compare()
1882 if (load_too_imbalanced(src_load, dst_load, env)) in task_numa_compare()
1888 int cpu = env->dst_stats.idle_cpu; in task_numa_compare()
1892 cpu = env->dst_cpu; in task_numa_compare()
1898 if (!idle_cpu(cpu) && env->best_cpu >= 0 && in task_numa_compare()
1899 idle_cpu(env->best_cpu)) { in task_numa_compare()
1900 cpu = env->best_cpu; in task_numa_compare()
1903 env->dst_cpu = cpu; in task_numa_compare()
1906 task_numa_assign(env, cur, imp); in task_numa_compare()
1913 if (maymove && !cur && env->best_cpu >= 0 && idle_cpu(env->best_cpu)) in task_numa_compare()
1920 if (!maymove && env->best_task && in task_numa_compare()
1921 env->best_task->numa_preferred_nid == env->src_nid) { in task_numa_compare()
1930 static void task_numa_find_cpu(struct task_numa_env *env, in task_numa_find_cpu() argument
1940 if (env->dst_stats.node_type == node_has_spare) { in task_numa_find_cpu()
1950 src_running = env->src_stats.nr_running - 1; in task_numa_find_cpu()
1951 dst_running = env->dst_stats.nr_running + 1; in task_numa_find_cpu()
1954 env->dst_stats.weight); in task_numa_find_cpu()
1959 if (env->dst_stats.idle_cpu >= 0) { in task_numa_find_cpu()
1960 env->dst_cpu = env->dst_stats.idle_cpu; in task_numa_find_cpu()
1961 task_numa_assign(env, NULL, 0); in task_numa_find_cpu()
1971 load = task_h_load(env->p); in task_numa_find_cpu()
1972 dst_load = env->dst_stats.load + load; in task_numa_find_cpu()
1973 src_load = env->src_stats.load - load; in task_numa_find_cpu()
1974 maymove = !load_too_imbalanced(src_load, dst_load, env); in task_numa_find_cpu()
1977 for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { in task_numa_find_cpu()
1979 if (!cpumask_test_cpu(cpu, env->p->cpus_ptr)) in task_numa_find_cpu()
1982 env->dst_cpu = cpu; in task_numa_find_cpu()
1983 if (task_numa_compare(env, taskimp, groupimp, maymove)) in task_numa_find_cpu()
1990 struct task_numa_env env = { in task_numa_migrate() local
2018 sd = rcu_dereference(per_cpu(sd_numa, env.src_cpu)); in task_numa_migrate()
2020 env.imbalance_pct = 100 + (sd->imbalance_pct - 100) / 2; in task_numa_migrate()
2034 env.dst_nid = p->numa_preferred_nid; in task_numa_migrate()
2035 dist = env.dist = node_distance(env.src_nid, env.dst_nid); in task_numa_migrate()
2036 taskweight = task_weight(p, env.src_nid, dist); in task_numa_migrate()
2037 groupweight = group_weight(p, env.src_nid, dist); in task_numa_migrate()
2038 update_numa_stats(&env, &env.src_stats, env.src_nid, false); in task_numa_migrate()
2039 taskimp = task_weight(p, env.dst_nid, dist) - taskweight; in task_numa_migrate()
2040 groupimp = group_weight(p, env.dst_nid, dist) - groupweight; in task_numa_migrate()
2041 update_numa_stats(&env, &env.dst_stats, env.dst_nid, true); in task_numa_migrate()
2044 task_numa_find_cpu(&env, taskimp, groupimp); in task_numa_migrate()
2054 if (env.best_cpu == -1 || (ng && ng->active_nodes > 1)) { in task_numa_migrate()
2056 if (nid == env.src_nid || nid == p->numa_preferred_nid) in task_numa_migrate()
2059 dist = node_distance(env.src_nid, env.dst_nid); in task_numa_migrate()
2061 dist != env.dist) { in task_numa_migrate()
2062 taskweight = task_weight(p, env.src_nid, dist); in task_numa_migrate()
2063 groupweight = group_weight(p, env.src_nid, dist); in task_numa_migrate()
2072 env.dist = dist; in task_numa_migrate()
2073 env.dst_nid = nid; in task_numa_migrate()
2074 update_numa_stats(&env, &env.dst_stats, env.dst_nid, true); in task_numa_migrate()
2075 task_numa_find_cpu(&env, taskimp, groupimp); in task_numa_migrate()
2088 if (env.best_cpu == -1) in task_numa_migrate()
2089 nid = env.src_nid; in task_numa_migrate()
2091 nid = cpu_to_node(env.best_cpu); in task_numa_migrate()
2098 if (env.best_cpu == -1) { in task_numa_migrate()
2099 trace_sched_stick_numa(p, env.src_cpu, NULL, -1); in task_numa_migrate()
2103 best_rq = cpu_rq(env.best_cpu); in task_numa_migrate()
2104 if (env.best_task == NULL) { in task_numa_migrate()
2105 ret = migrate_task_to(p, env.best_cpu); in task_numa_migrate()
2108 trace_sched_stick_numa(p, env.src_cpu, NULL, env.best_cpu); in task_numa_migrate()
2112 ret = migrate_swap(p, env.best_task, env.best_cpu, env.src_cpu); in task_numa_migrate()
2116 trace_sched_stick_numa(p, env.src_cpu, env.best_task, env.best_cpu); in task_numa_migrate()
2117 put_task_struct(env.best_task); in task_numa_migrate()
8046 static int task_hot(struct task_struct *p, struct lb_env *env) in task_hot() argument
8050 lockdep_assert_rq_held(env->src_rq); in task_hot()
8059 if (env->sd->flags & SD_SHARE_CPUCAPACITY) in task_hot()
8065 if (sched_feat(CACHE_HOT_BUDDY) && env->dst_rq->nr_running && in task_hot()
8077 if (!sched_core_cookie_match(cpu_rq(env->dst_cpu), p)) in task_hot()
8083 delta = rq_clock_task(env->src_rq) - p->se.exec_start; in task_hot()
8094 static int migrate_degrades_locality(struct task_struct *p, struct lb_env *env) in migrate_degrades_locality() argument
8103 if (!p->numa_faults || !(env->sd->flags & SD_NUMA)) in migrate_degrades_locality()
8106 src_nid = cpu_to_node(env->src_cpu); in migrate_degrades_locality()
8107 dst_nid = cpu_to_node(env->dst_cpu); in migrate_degrades_locality()
8114 if (env->src_rq->nr_running > env->src_rq->nr_preferred_running) in migrate_degrades_locality()
8125 if (env->idle == CPU_IDLE) in migrate_degrades_locality()
8142 struct lb_env *env) in migrate_degrades_locality() argument
8152 int can_migrate_task(struct task_struct *p, struct lb_env *env) in can_migrate_task() argument
8157 lockdep_assert_rq_held(env->src_rq); in can_migrate_task()
8159 trace_android_rvh_can_migrate_task(p, env->dst_cpu, &can_migrate); in can_migrate_task()
8170 if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu)) in can_migrate_task()
8177 if (!cpumask_test_cpu(env->dst_cpu, p->cpus_ptr)) { in can_migrate_task()
8182 env->flags |= LBF_SOME_PINNED; in can_migrate_task()
8194 if (env->idle == CPU_NEWLY_IDLE || in can_migrate_task()
8195 env->flags & (LBF_DST_PINNED | LBF_ACTIVE_LB)) in can_migrate_task()
8199 for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { in can_migrate_task()
8201 env->flags |= LBF_DST_PINNED; in can_migrate_task()
8202 env->new_dst_cpu = cpu; in can_migrate_task()
8211 env->flags &= ~LBF_ALL_PINNED; in can_migrate_task()
8213 if (task_running(env->src_rq, p)) { in can_migrate_task()
8225 if (env->flags & LBF_ACTIVE_LB) in can_migrate_task()
8228 tsk_cache_hot = migrate_degrades_locality(p, env); in can_migrate_task()
8230 tsk_cache_hot = task_hot(p, env); in can_migrate_task()
8233 env->sd->nr_balance_failed > env->sd->cache_nice_tries) { in can_migrate_task()
8235 schedstat_inc(env->sd->lb_hot_gained[env->idle]); in can_migrate_task()
8248 static void detach_task(struct task_struct *p, struct lb_env *env) in detach_task() argument
8252 lockdep_assert_rq_held(env->src_rq); in detach_task()
8259 trace_android_rvh_migrate_queued_task(env->src_rq, env->src_rq_rf, p, in detach_task()
8260 env->dst_cpu, &detached); in detach_task()
8264 deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK); in detach_task()
8265 set_task_cpu(p, env->dst_cpu); in detach_task()
8274 static struct task_struct *detach_one_task(struct lb_env *env) in detach_one_task() argument
8278 lockdep_assert_rq_held(env->src_rq); in detach_one_task()
8281 &env->src_rq->cfs_tasks, se.group_node) { in detach_one_task()
8282 if (!can_migrate_task(p, env)) in detach_one_task()
8285 detach_task(p, env); in detach_one_task()
8293 schedstat_inc(env->sd->lb_gained[env->idle]); in detach_one_task()
8307 static int detach_tasks(struct lb_env *env) in detach_tasks() argument
8309 struct list_head *tasks = &env->src_rq->cfs_tasks; in detach_tasks()
8314 lockdep_assert_rq_held(env->src_rq); in detach_tasks()
8320 if (env->src_rq->nr_running <= 1) { in detach_tasks()
8321 env->flags &= ~LBF_ALL_PINNED; in detach_tasks()
8325 if (env->imbalance <= 0) in detach_tasks()
8333 if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1) in detach_tasks()
8338 env->loop++; in detach_tasks()
8340 if (env->loop > env->loop_max) in detach_tasks()
8344 if (env->loop > env->loop_break) { in detach_tasks()
8345 env->loop_break += sched_nr_migrate_break; in detach_tasks()
8346 env->flags |= LBF_NEED_BREAK; in detach_tasks()
8350 if (!can_migrate_task(p, env)) in detach_tasks()
8353 switch (env->migration_type) { in detach_tasks()
8365 load < 16 && !env->sd->nr_balance_failed) in detach_tasks()
8374 if (shr_bound(load, env->sd->nr_balance_failed) > env->imbalance) in detach_tasks()
8377 env->imbalance -= load; in detach_tasks()
8383 if (util > env->imbalance) in detach_tasks()
8386 env->imbalance -= util; in detach_tasks()
8390 env->imbalance--; in detach_tasks()
8395 if (task_fits_cpu(p, env->src_cpu)) in detach_tasks()
8398 env->imbalance = 0; in detach_tasks()
8402 detach_task(p, env); in detach_tasks()
8403 list_add(&p->se.group_node, &env->tasks); in detach_tasks()
8413 if (env->idle == CPU_NEWLY_IDLE) in detach_tasks()
8421 if (env->imbalance <= 0) in detach_tasks()
8434 schedstat_add(env->sd->lb_gained[env->idle], detached); in detach_tasks()
8469 static void attach_tasks(struct lb_env *env) in attach_tasks() argument
8471 struct list_head *tasks = &env->tasks; in attach_tasks()
8475 rq_lock(env->dst_rq, &rf); in attach_tasks()
8476 update_rq_clock(env->dst_rq); in attach_tasks()
8482 attach_task(env->dst_rq, p); in attach_tasks()
8485 rq_unlock(env->dst_rq, &rf); in attach_tasks()
9063 static inline void update_sg_lb_stats(struct lb_env *env, in update_sg_lb_stats() argument
9072 local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(group)); in update_sg_lb_stats()
9074 for_each_cpu_and(i, sched_group_span(group), env->cpus) { in update_sg_lb_stats()
9108 if (env->sd->flags & SD_ASYM_CPUCAPACITY && in update_sg_lb_stats()
9116 if (env->sd->flags & SD_ASYM_PACKING && in update_sg_lb_stats()
9117 env->idle != CPU_NOT_IDLE && in update_sg_lb_stats()
9119 sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu)) { in update_sg_lb_stats()
9127 sgs->group_type = group_classify(env->sd->imbalance_pct, group, sgs); in update_sg_lb_stats()
9148 static bool update_sd_pick_busiest(struct lb_env *env, in update_sd_pick_busiest() argument
9166 (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) || in update_sd_pick_busiest()
9248 if ((env->sd->flags & SD_ASYM_CPUCAPACITY) && in update_sd_pick_busiest()
9250 (capacity_greater(sg->sgc->min_capacity, capacity_of(env->dst_cpu)))) in update_sd_pick_busiest()
9613 static void update_idle_cpu_scan(struct lb_env *env, in update_idle_cpu_scan() argument
9627 if (!sched_feat(SIS_UTIL) || env->idle == CPU_NEWLY_IDLE) in update_idle_cpu_scan()
9630 llc_weight = per_cpu(sd_llc_size, env->dst_cpu); in update_idle_cpu_scan()
9631 if (env->sd->span_weight != llc_weight) in update_idle_cpu_scan()
9634 sd_share = rcu_dereference(per_cpu(sd_llc_shared, env->dst_cpu)); in update_idle_cpu_scan()
9671 pct = env->sd->imbalance_pct; in update_idle_cpu_scan()
9690 static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sds) in update_sd_lb_stats() argument
9692 struct sched_domain *child = env->sd->child; in update_sd_lb_stats()
9693 struct sched_group *sg = env->sd->groups; in update_sd_lb_stats()
9703 local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(sg)); in update_sd_lb_stats()
9708 if (env->idle != CPU_NEWLY_IDLE || in update_sd_lb_stats()
9710 update_group_capacity(env->sd, env->dst_cpu); in update_sd_lb_stats()
9713 update_sg_lb_stats(env, sg, sgs, &sg_status); in update_sd_lb_stats()
9719 if (update_sd_pick_busiest(env, sds, sg, sgs)) { in update_sd_lb_stats()
9731 } while (sg != env->sd->groups); in update_sd_lb_stats()
9737 if (env->sd->flags & SD_NUMA) in update_sd_lb_stats()
9738 env->fbq_type = fbq_classify_group(&sds->busiest_stat); in update_sd_lb_stats()
9740 if (!env->sd->parent) { in update_sd_lb_stats()
9741 struct root_domain *rd = env->dst_rq->rd; in update_sd_lb_stats()
9750 struct root_domain *rd = env->dst_rq->rd; in update_sd_lb_stats()
9756 update_idle_cpu_scan(env, sum_util); in update_sd_lb_stats()
9783 static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *sds) in calculate_imbalance() argument
9792 env->migration_type = migrate_misfit; in calculate_imbalance()
9793 env->imbalance = 1; in calculate_imbalance()
9802 env->migration_type = migrate_task; in calculate_imbalance()
9803 env->imbalance = busiest->sum_h_nr_running; in calculate_imbalance()
9814 env->migration_type = migrate_task; in calculate_imbalance()
9815 env->imbalance = 1; in calculate_imbalance()
9825 !(env->sd->flags & SD_SHARE_PKG_RESOURCES)) { in calculate_imbalance()
9834 env->migration_type = migrate_util; in calculate_imbalance()
9835 env->imbalance = max(local->group_capacity, local->group_util) - in calculate_imbalance()
9845 if (env->idle != CPU_NOT_IDLE && env->imbalance == 0) { in calculate_imbalance()
9846 env->migration_type = migrate_task; in calculate_imbalance()
9847 env->imbalance = 1; in calculate_imbalance()
9859 env->migration_type = migrate_task; in calculate_imbalance()
9861 env->imbalance = nr_diff >> 1; in calculate_imbalance()
9868 env->migration_type = migrate_task; in calculate_imbalance()
9869 env->imbalance = max_t(long, 0, (local->idle_cpus - in calculate_imbalance()
9874 if (env->sd->flags & SD_NUMA) { in calculate_imbalance()
9875 env->imbalance = adjust_numa_imbalance(env->imbalance, in calculate_imbalance()
9900 env->imbalance = 0; in calculate_imbalance()
9912 env->imbalance = 0; in calculate_imbalance()
9926 env->migration_type = migrate_load; in calculate_imbalance()
9927 env->imbalance = min( in calculate_imbalance()
9966 static struct sched_group *find_busiest_group(struct lb_env *env) in find_busiest_group() argument
9977 update_sd_lb_stats(env, &sds); in find_busiest_group()
9990 struct root_domain *rd = env->dst_rq->rd; in find_busiest_group()
9993 trace_android_rvh_find_busiest_group(sds.busiest, env->dst_rq, in find_busiest_group()
10049 env->sd->imbalance_pct * local->avg_load) in find_busiest_group()
10059 if (env->idle == CPU_NOT_IDLE) in find_busiest_group()
10089 calculate_imbalance(env, &sds); in find_busiest_group()
10090 return env->imbalance ? sds.busiest : NULL; in find_busiest_group()
10093 env->imbalance = 0; in find_busiest_group()
10100 static struct rq *find_busiest_queue(struct lb_env *env, in find_busiest_queue() argument
10108 trace_android_rvh_find_busiest_queue(env->dst_cpu, group, env->cpus, in find_busiest_queue()
10113 for_each_cpu_and(i, sched_group_span(group), env->cpus) { in find_busiest_queue()
10140 if (rt > env->fbq_type) in find_busiest_queue()
10155 if (env->sd->flags & SD_ASYM_CPUCAPACITY && in find_busiest_queue()
10156 !capacity_greater(capacity_of(env->dst_cpu), capacity) && in find_busiest_queue()
10160 switch (env->migration_type) { in find_busiest_queue()
10168 if (nr_running == 1 && load > env->imbalance && in find_busiest_queue()
10169 !check_cpu_capacity(rq, env->sd)) in find_busiest_queue()
10241 asym_active_balance(struct lb_env *env) in asym_active_balance() argument
10248 return env->idle != CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_PACKING) && in asym_active_balance()
10249 sched_asym_prefer(env->dst_cpu, env->src_cpu); in asym_active_balance()
10253 imbalanced_active_balance(struct lb_env *env) in imbalanced_active_balance() argument
10255 struct sched_domain *sd = env->sd; in imbalanced_active_balance()
10262 if ((env->migration_type == migrate_task) && in imbalanced_active_balance()
10269 static int need_active_balance(struct lb_env *env) in need_active_balance() argument
10271 struct sched_domain *sd = env->sd; in need_active_balance()
10273 if (asym_active_balance(env)) in need_active_balance()
10276 if (imbalanced_active_balance(env)) in need_active_balance()
10285 if ((env->idle != CPU_NOT_IDLE) && in need_active_balance()
10286 (env->src_rq->cfs.h_nr_running == 1)) { in need_active_balance()
10287 if ((check_cpu_capacity(env->src_rq, sd)) && in need_active_balance()
10288 (capacity_of(env->src_cpu)*sd->imbalance_pct < capacity_of(env->dst_cpu)*100)) in need_active_balance()
10292 if (env->migration_type == migrate_misfit) in need_active_balance()
10300 static int should_we_balance(struct lb_env *env) in should_we_balance() argument
10302 struct sched_group *sg = env->sd->groups; in should_we_balance()
10309 if (!cpumask_test_cpu(env->dst_cpu, env->cpus)) in should_we_balance()
10316 if (env->idle == CPU_NEWLY_IDLE) in should_we_balance()
10320 for_each_cpu_and(cpu, group_balance_mask(sg), env->cpus) { in should_we_balance()
10325 return cpu == env->dst_cpu; in should_we_balance()
10329 return group_balance_cpu(sg) == env->dst_cpu; in should_we_balance()
10347 struct lb_env env = { in load_balance() local
10356 .tasks = LIST_HEAD_INIT(env.tasks), in load_balance()
10364 if (!should_we_balance(&env)) { in load_balance()
10369 group = find_busiest_group(&env); in load_balance()
10375 busiest = find_busiest_queue(&env, group); in load_balance()
10381 BUG_ON(busiest == env.dst_rq); in load_balance()
10383 schedstat_add(sd->lb_imbalance[idle], env.imbalance); in load_balance()
10385 env.src_cpu = busiest->cpu; in load_balance()
10386 env.src_rq = busiest; in load_balance()
10390 env.flags |= LBF_ALL_PINNED; in load_balance()
10398 env.loop_max = min(sysctl_sched_nr_migrate, busiest->nr_running); in load_balance()
10402 env.src_rq_rf = &rf; in load_balance()
10409 cur_ld_moved = detach_tasks(&env); in load_balance()
10422 attach_tasks(&env); in load_balance()
10428 if (env.flags & LBF_NEED_BREAK) { in load_balance()
10429 env.flags &= ~LBF_NEED_BREAK; in load_balance()
10452 if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) { in load_balance()
10455 __cpumask_clear_cpu(env.dst_cpu, env.cpus); in load_balance()
10457 env.dst_rq = cpu_rq(env.new_dst_cpu); in load_balance()
10458 env.dst_cpu = env.new_dst_cpu; in load_balance()
10459 env.flags &= ~LBF_DST_PINNED; in load_balance()
10460 env.loop = 0; in load_balance()
10461 env.loop_break = sched_nr_migrate_break; in load_balance()
10476 if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) in load_balance()
10481 if (unlikely(env.flags & LBF_ALL_PINNED)) { in load_balance()
10491 if (!cpumask_subset(cpus, env.dst_grpmask)) { in load_balance()
10492 env.loop = 0; in load_balance()
10493 env.loop_break = sched_nr_migrate_break; in load_balance()
10511 if (need_active_balance(&env)) { in load_balance()
10527 env.flags &= ~LBF_ALL_PINNED; in load_balance()
10553 if (likely(!active_balance) || need_active_balance(&env)) { in load_balance()
10566 if (sd_parent && !(env.flags & LBF_ALL_PINNED)) { in load_balance()
10592 if (env.idle == CPU_NEWLY_IDLE) in load_balance()
10596 if ((env.flags & LBF_ALL_PINNED && in load_balance()
10690 struct lb_env env = { in active_load_balance_cpu_stop() local
10704 p = detach_one_task(&env); in active_load_balance_cpu_stop()