Loading kernel/sched/boost.c +0 −9 Original line number Diff line number Diff line Loading @@ -156,9 +156,6 @@ void sched_boost_parse_dt(void) struct device_node *sn; const char *boost_policy; if (!sched_enable_hmp) return; sn = of_find_node_by_path("/sched-hmp"); if (!sn) return; Loading @@ -175,9 +172,6 @@ int sched_set_boost(int type) { int ret = 0; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&boost_mutex); if (verify_boost_params(sysctl_sched_boost, type)) Loading @@ -197,9 +191,6 @@ int sched_boost_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; unsigned int old_val; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&boost_mutex); old_val = *data; Loading kernel/sched/core.c +6 −4 Original line number Diff line number Diff line Loading @@ -3025,8 +3025,9 @@ void sched_exec(void) unsigned long flags; int dest_cpu, curr_cpu; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return; #endif raw_spin_lock_irqsave(&p->pi_lock, flags); curr_cpu = task_cpu(p); Loading Loading @@ -8215,8 +8216,9 @@ void __init sched_init(void) int i, j; unsigned long alloc_size = 0, ptr; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP pr_info("HMP scheduling enabled.\n"); #endif BUG_ON(num_possible_cpus() > BITS_PER_LONG); Loading kernel/sched/fair.c +16 −13 Original line number Diff line number Diff line Loading @@ -3332,9 +3332,9 @@ void _inc_hmp_sched_stats_fair(struct rq *rq, * inc/dec_nr_big_task and inc/dec_cumulative_runnable_avg called * from inc_cfs_rq_hmp_stats() have similar checks), we gain a bit on * efficiency by short-circuiting for_each_sched_entity() loop when * !sched_enable_hmp || sched_disable_window_stats * sched_disable_window_stats */ if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; for_each_sched_entity(se) { Loading @@ -3357,7 +3357,7 @@ _dec_hmp_sched_stats_fair(struct rq *rq, struct task_struct *p, int change_cra) struct sched_entity *se = &p->se; /* See comment on efficiency in _inc_hmp_sched_stats_fair */ if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; for_each_sched_entity(se) { Loading Loading @@ -3482,8 +3482,7 @@ static inline int migration_needed(struct task_struct *p, int cpu) int nice; struct related_thread_group *grp; if (!sched_enable_hmp || p->state != TASK_RUNNING || p->nr_cpus_allowed == 1) if (p->state != TASK_RUNNING || p->nr_cpus_allowed == 1) return 0; /* No need to migrate task that is about to be throttled */ Loading Loading @@ -7024,8 +7023,9 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f int want_affine = 0; int sync = wake_flags & WF_SYNC; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return select_best_cpu(p, prev_cpu, 0, sync); #endif if (sd_flag & SD_BALANCE_WAKE) want_affine = (!wake_wide(p) && task_fits_max(p, cpu) && Loading Loading @@ -9313,8 +9313,9 @@ static struct rq *find_busiest_queue(struct lb_env *env, unsigned long busiest_load = 0, busiest_capacity = 1; int i; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_busiest_queue_hmp(env, group); #endif for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { unsigned long capacity, wl; Loading Loading @@ -10120,8 +10121,9 @@ static inline int find_new_ilb(int type) { int ilb; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_new_hmp_ilb(type); #endif ilb = cpumask_first(nohz.idle_cpus_mask); Loading Loading @@ -10496,8 +10498,9 @@ static inline int _nohz_kick_needed(struct rq *rq, int cpu, int *type) if (likely(!atomic_read(&nohz.nr_cpus))) return 0; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return _nohz_kick_needed_hmp(rq, cpu, type); #endif if (time_before(now, nohz.next_balance)) return 0; Loading kernel/sched/hmp.c +5 −33 Original line number Diff line number Diff line Loading @@ -615,19 +615,6 @@ int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb) return 0; } int __init set_sched_enable_hmp(char *str) { int enable_hmp = 0; get_option(&str, &enable_hmp); sched_enable_hmp = !!enable_hmp; return 0; } early_param("sched_enable_hmp", set_sched_enable_hmp); /* Clear any HMP scheduler related requests pending from or on cpu */ void clear_hmp_request(int cpu) { Loading Loading @@ -869,9 +856,6 @@ unsigned int max_task_load(void) return sched_ravg_window; } /* Use this knob to turn on or off HMP-aware task placement logic */ unsigned int __read_mostly sched_enable_hmp; /* A cpu can no longer accommodate more tasks if: * * rq->nr_running > sysctl_sched_spill_nr_run || Loading Loading @@ -1244,7 +1228,7 @@ unlock: void inc_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) { if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; if (is_big_task(p)) Loading @@ -1253,7 +1237,7 @@ void inc_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) void dec_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) { if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; if (is_big_task(p)) Loading Loading @@ -1322,7 +1306,7 @@ void fixup_nr_big_tasks(struct hmp_sched_stats *stats, u64 new_task_load; u64 old_task_load; if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; old_task_load = scale_load_to_cpu(task_load(p), task_cpu(p)); Loading Loading @@ -1432,9 +1416,6 @@ int sched_window_update_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; unsigned int old_val; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&policy_mutex); old_val = *data; Loading Loading @@ -1470,9 +1451,6 @@ int sched_hmp_proc_update_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; int update_task_count = 0; if (!sched_enable_hmp) return 0; /* * The policy mutex is acquired with cpu_hotplug.lock * held from cpu_up()->cpufreq_governor_interactive()-> Loading Loading @@ -1749,9 +1727,6 @@ static int send_notification(struct rq *rq, int check_pred, int check_groups) int rc = 0; u64 group_load = 0, new_load = 0; if (!sched_enable_hmp) return 0; if (check_pred) { u64 prev = rq->old_busy_time; u64 predicted = rq->hmp_stats.pred_demands_sum; Loading Loading @@ -2960,7 +2935,7 @@ void set_window_start(struct rq *rq) { static int sync_cpu_available; if (rq->window_start || !sched_enable_hmp) if (rq->window_start) return; if (!sync_cpu_available) { Loading Loading @@ -3539,7 +3514,7 @@ void fixup_busy_time(struct task_struct *p, int new_cpu) bool new_task; struct related_thread_group *grp; if (!sched_enable_hmp || (!p->on_rq && p->state != TASK_WAKING)) if (!p->on_rq && p->state != TASK_WAKING) return; if (exiting_task(p)) { Loading Loading @@ -4246,9 +4221,6 @@ static int register_sched_callback(void) { int ret; if (!sched_enable_hmp) return 0; ret = cpufreq_register_notifier(¬ifier_policy_block, CPUFREQ_POLICY_NOTIFIER); Loading kernel/sched/rt.c +8 −12 Original line number Diff line number Diff line Loading @@ -1406,6 +1406,7 @@ static void yield_task_rt(struct rq *rq) #ifdef CONFIG_SMP static int find_lowest_rq(struct task_struct *task); #ifdef CONFIG_SCHED_HMP static int select_task_rq_rt_hmp(struct task_struct *p, int cpu, int sd_flag, int flags) { Loading @@ -1419,6 +1420,7 @@ select_task_rq_rt_hmp(struct task_struct *p, int cpu, int sd_flag, int flags) return cpu; } #endif static int select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) Loading @@ -1426,8 +1428,9 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) struct task_struct *curr; struct rq *rq; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return select_task_rq_rt_hmp(p, cpu, sd_flag, flags); #endif /* For anything but wake ups, just return the task_cpu */ if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK) Loading Loading @@ -1796,14 +1799,6 @@ static int find_lowest_rq_hmp(struct task_struct *task) return best_cpu; } #else /* CONFIG_SCHED_HMP */ static int find_lowest_rq_hmp(struct task_struct *task) { return -1; } #endif /* CONFIG_SCHED_HMP */ static int find_lowest_rq(struct task_struct *task) Loading @@ -1813,8 +1808,9 @@ static int find_lowest_rq(struct task_struct *task) int this_cpu = smp_processor_id(); int cpu = task_cpu(task); if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_lowest_rq_hmp(task); #endif /* Make sure the mask is initialized first */ if (unlikely(!lowest_mask)) Loading Loading
kernel/sched/boost.c +0 −9 Original line number Diff line number Diff line Loading @@ -156,9 +156,6 @@ void sched_boost_parse_dt(void) struct device_node *sn; const char *boost_policy; if (!sched_enable_hmp) return; sn = of_find_node_by_path("/sched-hmp"); if (!sn) return; Loading @@ -175,9 +172,6 @@ int sched_set_boost(int type) { int ret = 0; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&boost_mutex); if (verify_boost_params(sysctl_sched_boost, type)) Loading @@ -197,9 +191,6 @@ int sched_boost_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; unsigned int old_val; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&boost_mutex); old_val = *data; Loading
kernel/sched/core.c +6 −4 Original line number Diff line number Diff line Loading @@ -3025,8 +3025,9 @@ void sched_exec(void) unsigned long flags; int dest_cpu, curr_cpu; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return; #endif raw_spin_lock_irqsave(&p->pi_lock, flags); curr_cpu = task_cpu(p); Loading Loading @@ -8215,8 +8216,9 @@ void __init sched_init(void) int i, j; unsigned long alloc_size = 0, ptr; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP pr_info("HMP scheduling enabled.\n"); #endif BUG_ON(num_possible_cpus() > BITS_PER_LONG); Loading
kernel/sched/fair.c +16 −13 Original line number Diff line number Diff line Loading @@ -3332,9 +3332,9 @@ void _inc_hmp_sched_stats_fair(struct rq *rq, * inc/dec_nr_big_task and inc/dec_cumulative_runnable_avg called * from inc_cfs_rq_hmp_stats() have similar checks), we gain a bit on * efficiency by short-circuiting for_each_sched_entity() loop when * !sched_enable_hmp || sched_disable_window_stats * sched_disable_window_stats */ if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; for_each_sched_entity(se) { Loading @@ -3357,7 +3357,7 @@ _dec_hmp_sched_stats_fair(struct rq *rq, struct task_struct *p, int change_cra) struct sched_entity *se = &p->se; /* See comment on efficiency in _inc_hmp_sched_stats_fair */ if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; for_each_sched_entity(se) { Loading Loading @@ -3482,8 +3482,7 @@ static inline int migration_needed(struct task_struct *p, int cpu) int nice; struct related_thread_group *grp; if (!sched_enable_hmp || p->state != TASK_RUNNING || p->nr_cpus_allowed == 1) if (p->state != TASK_RUNNING || p->nr_cpus_allowed == 1) return 0; /* No need to migrate task that is about to be throttled */ Loading Loading @@ -7024,8 +7023,9 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f int want_affine = 0; int sync = wake_flags & WF_SYNC; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return select_best_cpu(p, prev_cpu, 0, sync); #endif if (sd_flag & SD_BALANCE_WAKE) want_affine = (!wake_wide(p) && task_fits_max(p, cpu) && Loading Loading @@ -9313,8 +9313,9 @@ static struct rq *find_busiest_queue(struct lb_env *env, unsigned long busiest_load = 0, busiest_capacity = 1; int i; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_busiest_queue_hmp(env, group); #endif for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { unsigned long capacity, wl; Loading Loading @@ -10120,8 +10121,9 @@ static inline int find_new_ilb(int type) { int ilb; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_new_hmp_ilb(type); #endif ilb = cpumask_first(nohz.idle_cpus_mask); Loading Loading @@ -10496,8 +10498,9 @@ static inline int _nohz_kick_needed(struct rq *rq, int cpu, int *type) if (likely(!atomic_read(&nohz.nr_cpus))) return 0; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return _nohz_kick_needed_hmp(rq, cpu, type); #endif if (time_before(now, nohz.next_balance)) return 0; Loading
kernel/sched/hmp.c +5 −33 Original line number Diff line number Diff line Loading @@ -615,19 +615,6 @@ int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb) return 0; } int __init set_sched_enable_hmp(char *str) { int enable_hmp = 0; get_option(&str, &enable_hmp); sched_enable_hmp = !!enable_hmp; return 0; } early_param("sched_enable_hmp", set_sched_enable_hmp); /* Clear any HMP scheduler related requests pending from or on cpu */ void clear_hmp_request(int cpu) { Loading Loading @@ -869,9 +856,6 @@ unsigned int max_task_load(void) return sched_ravg_window; } /* Use this knob to turn on or off HMP-aware task placement logic */ unsigned int __read_mostly sched_enable_hmp; /* A cpu can no longer accommodate more tasks if: * * rq->nr_running > sysctl_sched_spill_nr_run || Loading Loading @@ -1244,7 +1228,7 @@ unlock: void inc_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) { if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; if (is_big_task(p)) Loading @@ -1253,7 +1237,7 @@ void inc_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) void dec_nr_big_task(struct hmp_sched_stats *stats, struct task_struct *p) { if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; if (is_big_task(p)) Loading Loading @@ -1322,7 +1306,7 @@ void fixup_nr_big_tasks(struct hmp_sched_stats *stats, u64 new_task_load; u64 old_task_load; if (!sched_enable_hmp || sched_disable_window_stats) if (sched_disable_window_stats) return; old_task_load = scale_load_to_cpu(task_load(p), task_cpu(p)); Loading Loading @@ -1432,9 +1416,6 @@ int sched_window_update_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; unsigned int old_val; if (!sched_enable_hmp) return -EINVAL; mutex_lock(&policy_mutex); old_val = *data; Loading Loading @@ -1470,9 +1451,6 @@ int sched_hmp_proc_update_handler(struct ctl_table *table, int write, unsigned int *data = (unsigned int *)table->data; int update_task_count = 0; if (!sched_enable_hmp) return 0; /* * The policy mutex is acquired with cpu_hotplug.lock * held from cpu_up()->cpufreq_governor_interactive()-> Loading Loading @@ -1749,9 +1727,6 @@ static int send_notification(struct rq *rq, int check_pred, int check_groups) int rc = 0; u64 group_load = 0, new_load = 0; if (!sched_enable_hmp) return 0; if (check_pred) { u64 prev = rq->old_busy_time; u64 predicted = rq->hmp_stats.pred_demands_sum; Loading Loading @@ -2960,7 +2935,7 @@ void set_window_start(struct rq *rq) { static int sync_cpu_available; if (rq->window_start || !sched_enable_hmp) if (rq->window_start) return; if (!sync_cpu_available) { Loading Loading @@ -3539,7 +3514,7 @@ void fixup_busy_time(struct task_struct *p, int new_cpu) bool new_task; struct related_thread_group *grp; if (!sched_enable_hmp || (!p->on_rq && p->state != TASK_WAKING)) if (!p->on_rq && p->state != TASK_WAKING) return; if (exiting_task(p)) { Loading Loading @@ -4246,9 +4221,6 @@ static int register_sched_callback(void) { int ret; if (!sched_enable_hmp) return 0; ret = cpufreq_register_notifier(¬ifier_policy_block, CPUFREQ_POLICY_NOTIFIER); Loading
kernel/sched/rt.c +8 −12 Original line number Diff line number Diff line Loading @@ -1406,6 +1406,7 @@ static void yield_task_rt(struct rq *rq) #ifdef CONFIG_SMP static int find_lowest_rq(struct task_struct *task); #ifdef CONFIG_SCHED_HMP static int select_task_rq_rt_hmp(struct task_struct *p, int cpu, int sd_flag, int flags) { Loading @@ -1419,6 +1420,7 @@ select_task_rq_rt_hmp(struct task_struct *p, int cpu, int sd_flag, int flags) return cpu; } #endif static int select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) Loading @@ -1426,8 +1428,9 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) struct task_struct *curr; struct rq *rq; if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return select_task_rq_rt_hmp(p, cpu, sd_flag, flags); #endif /* For anything but wake ups, just return the task_cpu */ if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK) Loading Loading @@ -1796,14 +1799,6 @@ static int find_lowest_rq_hmp(struct task_struct *task) return best_cpu; } #else /* CONFIG_SCHED_HMP */ static int find_lowest_rq_hmp(struct task_struct *task) { return -1; } #endif /* CONFIG_SCHED_HMP */ static int find_lowest_rq(struct task_struct *task) Loading @@ -1813,8 +1808,9 @@ static int find_lowest_rq(struct task_struct *task) int this_cpu = smp_processor_id(); int cpu = task_cpu(task); if (sched_enable_hmp) #ifdef CONFIG_SCHED_HMP return find_lowest_rq_hmp(task); #endif /* Make sure the mask is initialized first */ if (unlikely(!lowest_mask)) Loading