Loading drivers/cpufreq/cpufreq_interactive.c +22 −2 Original line number Diff line number Diff line Loading @@ -127,6 +127,13 @@ struct cpufreq_interactive_tunables { bool use_sched_load; bool use_migration_notif; /* * Whether to align timer windows across all CPUs. When * use_sched_load is true, this flag is ignored and windows * will always be aligned. */ bool align_windows; /* * Stay at max freq for at least max_freq_hysteresis before dropping * frequency. Loading @@ -144,9 +151,16 @@ static u64 round_to_nw_start(u64 jif, struct cpufreq_interactive_tunables *tunables) { unsigned long step = usecs_to_jiffies(tunables->timer_rate); u64 ret; if (tunables->use_sched_load || tunables->align_windows) { do_div(jif, step); return (jif + 1) * step; ret = (jif + 1) * step; } else { ret = jiffies + usecs_to_jiffies(tunables->timer_rate); } return ret; } static inline int set_window_helper( Loading Loading @@ -966,6 +980,7 @@ static ssize_t store_##file_name( \ return count; \ } show_store_one(max_freq_hysteresis); show_store_one(align_windows); static ssize_t show_go_hispeed_load(struct cpufreq_interactive_tunables *tunables, char *buf) Loading Loading @@ -1346,6 +1361,7 @@ show_store_gov_pol_sys(io_is_busy); show_store_gov_pol_sys(use_sched_load); show_store_gov_pol_sys(use_migration_notif); show_store_gov_pol_sys(max_freq_hysteresis); show_store_gov_pol_sys(align_windows); #define gov_sys_attr_rw(_name) \ static struct global_attr _name##_gov_sys = \ Loading @@ -1372,6 +1388,7 @@ gov_sys_pol_attr_rw(io_is_busy); gov_sys_pol_attr_rw(use_sched_load); gov_sys_pol_attr_rw(use_migration_notif); gov_sys_pol_attr_rw(max_freq_hysteresis); gov_sys_pol_attr_rw(align_windows); static struct global_attr boostpulse_gov_sys = __ATTR(boostpulse, 0200, NULL, store_boostpulse_gov_sys); Loading @@ -1395,6 +1412,7 @@ static struct attribute *interactive_attributes_gov_sys[] = { &use_sched_load_gov_sys.attr, &use_migration_notif_gov_sys.attr, &max_freq_hysteresis_gov_sys.attr, &align_windows_gov_sys.attr, NULL, }; Loading @@ -1419,6 +1437,7 @@ static struct attribute *interactive_attributes_gov_pol[] = { &use_sched_load_gov_pol.attr, &use_migration_notif_gov_pol.attr, &max_freq_hysteresis_gov_pol.attr, &align_windows_gov_pol.attr, NULL, }; Loading Loading @@ -1492,6 +1511,7 @@ static struct cpufreq_interactive_tunables *alloc_tunable( tunables->timer_rate = DEFAULT_TIMER_RATE; tunables->boostpulse_duration_val = DEFAULT_MIN_SAMPLE_TIME; tunables->timer_slack_val = DEFAULT_TIMER_SLACK; tunables->align_windows = true; spin_lock_init(&tunables->target_loads_lock); spin_lock_init(&tunables->above_hispeed_delay_lock); Loading Loading
drivers/cpufreq/cpufreq_interactive.c +22 −2 Original line number Diff line number Diff line Loading @@ -127,6 +127,13 @@ struct cpufreq_interactive_tunables { bool use_sched_load; bool use_migration_notif; /* * Whether to align timer windows across all CPUs. When * use_sched_load is true, this flag is ignored and windows * will always be aligned. */ bool align_windows; /* * Stay at max freq for at least max_freq_hysteresis before dropping * frequency. Loading @@ -144,9 +151,16 @@ static u64 round_to_nw_start(u64 jif, struct cpufreq_interactive_tunables *tunables) { unsigned long step = usecs_to_jiffies(tunables->timer_rate); u64 ret; if (tunables->use_sched_load || tunables->align_windows) { do_div(jif, step); return (jif + 1) * step; ret = (jif + 1) * step; } else { ret = jiffies + usecs_to_jiffies(tunables->timer_rate); } return ret; } static inline int set_window_helper( Loading Loading @@ -966,6 +980,7 @@ static ssize_t store_##file_name( \ return count; \ } show_store_one(max_freq_hysteresis); show_store_one(align_windows); static ssize_t show_go_hispeed_load(struct cpufreq_interactive_tunables *tunables, char *buf) Loading Loading @@ -1346,6 +1361,7 @@ show_store_gov_pol_sys(io_is_busy); show_store_gov_pol_sys(use_sched_load); show_store_gov_pol_sys(use_migration_notif); show_store_gov_pol_sys(max_freq_hysteresis); show_store_gov_pol_sys(align_windows); #define gov_sys_attr_rw(_name) \ static struct global_attr _name##_gov_sys = \ Loading @@ -1372,6 +1388,7 @@ gov_sys_pol_attr_rw(io_is_busy); gov_sys_pol_attr_rw(use_sched_load); gov_sys_pol_attr_rw(use_migration_notif); gov_sys_pol_attr_rw(max_freq_hysteresis); gov_sys_pol_attr_rw(align_windows); static struct global_attr boostpulse_gov_sys = __ATTR(boostpulse, 0200, NULL, store_boostpulse_gov_sys); Loading @@ -1395,6 +1412,7 @@ static struct attribute *interactive_attributes_gov_sys[] = { &use_sched_load_gov_sys.attr, &use_migration_notif_gov_sys.attr, &max_freq_hysteresis_gov_sys.attr, &align_windows_gov_sys.attr, NULL, }; Loading @@ -1419,6 +1437,7 @@ static struct attribute *interactive_attributes_gov_pol[] = { &use_sched_load_gov_pol.attr, &use_migration_notif_gov_pol.attr, &max_freq_hysteresis_gov_pol.attr, &align_windows_gov_pol.attr, NULL, }; Loading Loading @@ -1492,6 +1511,7 @@ static struct cpufreq_interactive_tunables *alloc_tunable( tunables->timer_rate = DEFAULT_TIMER_RATE; tunables->boostpulse_duration_val = DEFAULT_MIN_SAMPLE_TIME; tunables->timer_slack_val = DEFAULT_TIMER_SLACK; tunables->align_windows = true; spin_lock_init(&tunables->target_loads_lock); spin_lock_init(&tunables->above_hispeed_delay_lock); Loading