Skip to content

Commit 97450eb

Browse files
vingu-linaroIngo Molnar
authored andcommitted
sched/pelt: Remove shift of thermal clock
The optional shift of the clock used by thermal/hw load avg has been introduced to handle case where the signal was not always a high frequency hw signal. Now that cpufreq provides a signal for firmware and SW pressure, we can remove this exception and always keep this PELT signal aligned with other signals. Mark sysctl_sched_migration_cost boot parameter as deprecated Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Tested-by: Lukasz Luba <[email protected]> Reviewed-by: Qais Yousef <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d4dbc99 commit 97450eb

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,6 +5807,7 @@
58075807
but is useful for debugging and performance tuning.
58085808

58095809
sched_thermal_decay_shift=
5810+
[Deprecated]
58105811
[KNL, SMP] Set a decay shift for scheduler thermal
58115812
pressure signal. Thermal pressure signal follows the
58125813
default decay period of other scheduler pelt

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5680,7 +5680,7 @@ void sched_tick(void)
56805680

56815681
update_rq_clock(rq);
56825682
hw_pressure = arch_scale_hw_pressure(cpu_of(rq));
5683-
update_hw_load_avg(rq_clock_hw(rq), rq, hw_pressure);
5683+
update_hw_load_avg(rq_clock_task(rq), rq, hw_pressure);
56845684
curr->sched_class->task_tick(rq, curr, 0);
56855685
if (sched_feat(LATENCY_WARN))
56865686
resched_latency = cpu_resched_latency(rq);

kernel/sched/fair.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,9 @@ static unsigned int normalized_sysctl_sched_base_slice = 750000ULL;
7878

7979
const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
8080

81-
int sched_hw_decay_shift;
8281
static int __init setup_sched_thermal_decay_shift(char *str)
8382
{
84-
int _shift = 0;
85-
86-
if (kstrtoint(str, 0, &_shift))
87-
pr_warn("Unable to set scheduler thermal pressure decay shift parameter\n");
88-
89-
sched_hw_decay_shift = clamp(_shift, 0, 10);
83+
pr_warn("Ignoring the deprecated sched_thermal_decay_shift= option\n");
9084
return 1;
9185
}
9286
__setup("sched_thermal_decay_shift=", setup_sched_thermal_decay_shift);
@@ -9367,7 +9361,7 @@ static bool __update_blocked_others(struct rq *rq, bool *done)
93679361

93689362
decayed = update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) |
93699363
update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) |
9370-
update_hw_load_avg(rq_clock_hw(rq), rq, hw_pressure) |
9364+
update_hw_load_avg(now, rq, hw_pressure) |
93719365
update_irq_load_avg(rq, 0);
93729366

93739367
if (others_have_blocked(rq))

kernel/sched/sched.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,24 +1550,6 @@ static inline u64 rq_clock_task(struct rq *rq)
15501550
return rq->clock_task;
15511551
}
15521552

1553-
/**
1554-
* By default the decay is the default pelt decay period.
1555-
* The decay shift can change the decay period in
1556-
* multiples of 32.
1557-
* Decay shift Decay period(ms)
1558-
* 0 32
1559-
* 1 64
1560-
* 2 128
1561-
* 3 256
1562-
* 4 512
1563-
*/
1564-
extern int sched_hw_decay_shift;
1565-
1566-
static inline u64 rq_clock_hw(struct rq *rq)
1567-
{
1568-
return rq_clock_task(rq) >> sched_hw_decay_shift;
1569-
}
1570-
15711553
static inline void rq_clock_skip_update(struct rq *rq)
15721554
{
15731555
lockdep_assert_rq_held(rq);

0 commit comments

Comments
 (0)