Skip to content

Commit 8ec59c0

Browse files
vingu-linaroIngo Molnar
authored andcommitted
sched/topology: Remove unused 'sd' parameter from arch_scale_cpu_capacity()
The 'struct sched_domain *sd' parameter to arch_scale_cpu_capacity() is unused since commit: 765d0af ("sched/topology: Remove the ::smt_gain field from 'struct sched_domain'") Remove it. Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Reviewed-by: Valentin Schneider <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent d2abae7 commit 8ec59c0

File tree

13 files changed

+22
-30
lines changed

13 files changed

+22
-30
lines changed

arch/arm/kernel/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void update_cpu_capacity(unsigned int cpu)
169169
topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
170170

171171
pr_info("CPU%u: update cpu_capacity %lu\n",
172-
cpu, topology_get_cpu_scale(NULL, cpu));
172+
cpu, topology_get_cpu_scale(cpu));
173173
}
174174

175175
#else

drivers/base/arch_topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static ssize_t cpu_capacity_show(struct device *dev,
4343
{
4444
struct cpu *cpu = container_of(dev, struct cpu, dev);
4545

46-
return sprintf(buf, "%lu\n", topology_get_cpu_scale(NULL, cpu->dev.id));
46+
return sprintf(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id));
4747
}
4848

4949
static void update_topology_flags_workfn(struct work_struct *work);
@@ -116,7 +116,7 @@ void topology_normalize_cpu_scale(void)
116116
/ capacity_scale;
117117
topology_set_cpu_scale(cpu, capacity);
118118
pr_debug("cpu_capacity: CPU%d cpu_capacity=%lu\n",
119-
cpu, topology_get_cpu_scale(NULL, cpu));
119+
cpu, topology_get_cpu_scale(cpu));
120120
}
121121
}
122122

@@ -185,7 +185,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
185185
cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus);
186186

187187
for_each_cpu(cpu, policy->related_cpus) {
188-
raw_capacity[cpu] = topology_get_cpu_scale(NULL, cpu) *
188+
raw_capacity[cpu] = topology_get_cpu_scale(cpu) *
189189
policy->cpuinfo.max_freq / 1000UL;
190190
capacity_scale = max(raw_capacity[cpu], capacity_scale);
191191
}

include/linux/arch_topology.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DECLARE_PER_CPU(unsigned long, cpu_scale);
1818

1919
struct sched_domain;
2020
static inline
21-
unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu)
21+
unsigned long topology_get_cpu_scale(int cpu)
2222
{
2323
return per_cpu(cpu_scale, cpu);
2424
}

include/linux/energy_model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static inline unsigned long em_pd_energy(struct em_perf_domain *pd,
8989
* like schedutil.
9090
*/
9191
cpu = cpumask_first(to_cpumask(pd->cpus));
92-
scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
92+
scale_cpu = arch_scale_cpu_capacity(cpu);
9393
cs = &pd->table[pd->nr_cap_states - 1];
9494
freq = map_util_freq(max_util, cs->frequency, scale_cpu);
9595

include/linux/sched/topology.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,6 @@ extern void set_sched_topology(struct sched_domain_topology_level *tl);
196196
# define SD_INIT_NAME(type)
197197
#endif
198198

199-
#ifndef arch_scale_cpu_capacity
200-
static __always_inline
201-
unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu)
202-
{
203-
return SCHED_CAPACITY_SCALE;
204-
}
205-
#endif
206-
207199
#else /* CONFIG_SMP */
208200

209201
struct sched_domain_attr;
@@ -219,16 +211,16 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
219211
return true;
220212
}
221213

214+
#endif /* !CONFIG_SMP */
215+
222216
#ifndef arch_scale_cpu_capacity
223217
static __always_inline
224-
unsigned long arch_scale_cpu_capacity(void __always_unused *sd, int cpu)
218+
unsigned long arch_scale_cpu_capacity(int cpu)
225219
{
226220
return SCHED_CAPACITY_SCALE;
227221
}
228222
#endif
229223

230-
#endif /* !CONFIG_SMP */
231-
232224
static inline int task_node(const struct task_struct *p)
233225
{
234226
return cpu_to_node(task_cpu(p));

kernel/power/energy_model.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ int em_register_perf_domain(cpumask_t *span, unsigned int nr_states,
223223
* All CPUs of a domain must have the same micro-architecture
224224
* since they all share the same table.
225225
*/
226-
cap = arch_scale_cpu_capacity(NULL, cpu);
226+
cap = arch_scale_cpu_capacity(cpu);
227227
if (prev_cap && prev_cap != cap) {
228228
pr_err("CPUs of %*pbl must have the same capacity\n",
229229
cpumask_pr_args(span));

kernel/sched/cpufreq_schedutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
276276
{
277277
struct rq *rq = cpu_rq(sg_cpu->cpu);
278278
unsigned long util = cpu_util_cfs(rq);
279-
unsigned long max = arch_scale_cpu_capacity(NULL, sg_cpu->cpu);
279+
unsigned long max = arch_scale_cpu_capacity(sg_cpu->cpu);
280280

281281
sg_cpu->max = max;
282282
sg_cpu->bw_dl = cpu_bw_dl(rq);

kernel/sched/deadline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ static void update_curr_dl(struct rq *rq)
11951195
&curr->dl);
11961196
} else {
11971197
unsigned long scale_freq = arch_scale_freq_capacity(cpu);
1198-
unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
1198+
unsigned long scale_cpu = arch_scale_cpu_capacity(cpu);
11991199

12001200
scaled_delta_exec = cap_scale(delta_exec, scale_freq);
12011201
scaled_delta_exec = cap_scale(scaled_delta_exec, scale_cpu);

kernel/sched/fair.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void post_init_entity_util_avg(struct task_struct *p)
764764
struct sched_entity *se = &p->se;
765765
struct cfs_rq *cfs_rq = cfs_rq_of(se);
766766
struct sched_avg *sa = &se->avg;
767-
long cpu_scale = arch_scale_cpu_capacity(NULL, cpu_of(rq_of(cfs_rq)));
767+
long cpu_scale = arch_scale_cpu_capacity(cpu_of(rq_of(cfs_rq)));
768768
long cap = (long)(cpu_scale - cfs_rq->avg.util_avg) / 2;
769769

770770
if (cap > 0) {
@@ -7646,7 +7646,7 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds)
76467646
static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
76477647
{
76487648
struct rq *rq = cpu_rq(cpu);
7649-
unsigned long max = arch_scale_cpu_capacity(sd, cpu);
7649+
unsigned long max = arch_scale_cpu_capacity(cpu);
76507650
unsigned long used, free;
76517651
unsigned long irq;
76527652

@@ -7671,7 +7671,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
76717671
unsigned long capacity = scale_rt_capacity(sd, cpu);
76727672
struct sched_group *sdg = sd->groups;
76737673

7674-
cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);
7674+
cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(cpu);
76757675

76767676
if (!capacity)
76777677
capacity = 1;

kernel/sched/pelt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ int update_irq_load_avg(struct rq *rq, u64 running)
366366
* reflect the real amount of computation
367367
*/
368368
running = cap_scale(running, arch_scale_freq_capacity(cpu_of(rq)));
369-
running = cap_scale(running, arch_scale_cpu_capacity(NULL, cpu_of(rq)));
369+
running = cap_scale(running, arch_scale_cpu_capacity(cpu_of(rq)));
370370

371371
/*
372372
* We know the time that has been used by interrupt since last update

0 commit comments

Comments
 (0)