sched/topology: Remove unused 'sd' parameter from arch_scale_cpu_capacity()
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 17 Jun 2019 15:00:17 +0000 (17:00 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 24 Jun 2019 17:23:39 +0000 (19:23 +0200)
The 'struct sched_domain *sd' parameter to arch_scale_cpu_capacity() is
unused since commit:

  765d0af19f5f ("sched/topology: Remove the ::smt_gain field from 'struct sched_domain'")

Remove it.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: gregkh@linuxfoundation.org
Cc: linux@armlinux.org.uk
Cc: quentin.perret@arm.com
Cc: rafael@kernel.org
Link: https://lkml.kernel.org/r/1560783617-5827-1-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
13 files changed:
arch/arm/kernel/topology.c
drivers/base/arch_topology.c
include/linux/arch_topology.h
include/linux/energy_model.h
include/linux/sched/topology.h
kernel/power/energy_model.c
kernel/sched/cpufreq_schedutil.c
kernel/sched/deadline.c
kernel/sched/fair.c
kernel/sched/pelt.c
kernel/sched/pelt.h
kernel/sched/sched.h
kernel/sched/topology.c

index 60e375ce1ab2c4f5ad9c773951c4e068f72f2c1b..d17cb1e6d67924b059a8aa855591aa9fad7305bd 100644 (file)
@@ -169,7 +169,7 @@ static void update_cpu_capacity(unsigned int cpu)
        topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
 
        pr_info("CPU%u: update cpu_capacity %lu\n",
-               cpu, topology_get_cpu_scale(NULL, cpu));
+               cpu, topology_get_cpu_scale(cpu));
 }
 
 #else
index 1739d7e1952af6e7aadce368fac44b3c189106d9..9b09e31ae82fddf1df399dfd67f386a321133c15 100644 (file)
@@ -43,7 +43,7 @@ static ssize_t cpu_capacity_show(struct device *dev,
 {
        struct cpu *cpu = container_of(dev, struct cpu, dev);
 
-       return sprintf(buf, "%lu\n", topology_get_cpu_scale(NULL, cpu->dev.id));
+       return sprintf(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id));
 }
 
 static void update_topology_flags_workfn(struct work_struct *work);
@@ -116,7 +116,7 @@ void topology_normalize_cpu_scale(void)
                        / capacity_scale;
                topology_set_cpu_scale(cpu, capacity);
                pr_debug("cpu_capacity: CPU%d cpu_capacity=%lu\n",
-                       cpu, topology_get_cpu_scale(NULL, cpu));
+                       cpu, topology_get_cpu_scale(cpu));
        }
 }
 
@@ -185,7 +185,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
        cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus);
 
        for_each_cpu(cpu, policy->related_cpus) {
-               raw_capacity[cpu] = topology_get_cpu_scale(NULL, cpu) *
+               raw_capacity[cpu] = topology_get_cpu_scale(cpu) *
                                    policy->cpuinfo.max_freq / 1000UL;
                capacity_scale = max(raw_capacity[cpu], capacity_scale);
        }
index d9bdc1a7f4e7aa9874e60f3dd29ef3175f11ed6c..1cfe05ea1d896124990f0133e2b8037edebc7a2e 100644 (file)
@@ -18,7 +18,7 @@ DECLARE_PER_CPU(unsigned long, cpu_scale);
 
 struct sched_domain;
 static inline
-unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu)
+unsigned long topology_get_cpu_scale(int cpu)
 {
        return per_cpu(cpu_scale, cpu);
 }
index aa027f7bcb3e848e947340562a0e04f7763009f4..73f8c3cb958888ab2c251f19bd5f4cd87854e1fb 100644 (file)
@@ -89,7 +89,7 @@ static inline unsigned long em_pd_energy(struct em_perf_domain *pd,
         * like schedutil.
         */
        cpu = cpumask_first(to_cpumask(pd->cpus));
-       scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+       scale_cpu = arch_scale_cpu_capacity(cpu);
        cs = &pd->table[pd->nr_cap_states - 1];
        freq = map_util_freq(max_util, cs->frequency, scale_cpu);
 
index 53afbe07354a450210c0c2a9530ed97ce949dc1b..e445d3767cddb191c9fe1591408b07a87846ca19 100644 (file)
@@ -196,14 +196,6 @@ extern void set_sched_topology(struct sched_domain_topology_level *tl);
 # define SD_INIT_NAME(type)
 #endif
 
-#ifndef arch_scale_cpu_capacity
-static __always_inline
-unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu)
-{
-       return SCHED_CAPACITY_SCALE;
-}
-#endif
-
 #else /* CONFIG_SMP */
 
 struct sched_domain_attr;
@@ -219,16 +211,16 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
        return true;
 }
 
+#endif /* !CONFIG_SMP */
+
 #ifndef arch_scale_cpu_capacity
 static __always_inline
-unsigned long arch_scale_cpu_capacity(void __always_unused *sd, int cpu)
+unsigned long arch_scale_cpu_capacity(int cpu)
 {
        return SCHED_CAPACITY_SCALE;
 }
 #endif
 
-#endif /* !CONFIG_SMP */
-
 static inline int task_node(const struct task_struct *p)
 {
        return cpu_to_node(task_cpu(p));
index 7d66ee68aaaf6f1b821d6fa148f56e1420ccb91a..0a9326f5f42181e8fc0c51ecd659f19589306565 100644 (file)
@@ -223,7 +223,7 @@ int em_register_perf_domain(cpumask_t *span, unsigned int nr_states,
                 * All CPUs of a domain must have the same micro-architecture
                 * since they all share the same table.
                 */
-               cap = arch_scale_cpu_capacity(NULL, cpu);
+               cap = arch_scale_cpu_capacity(cpu);
                if (prev_cap && prev_cap != cap) {
                        pr_err("CPUs of %*pbl must have the same capacity\n",
                                                        cpumask_pr_args(span));
index 962cf343f798f860654015b68aee5923d1ccf2bb..7c4ce69067c4000320dd1059577efa39e897ff64 100644 (file)
@@ -276,7 +276,7 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
 {
        struct rq *rq = cpu_rq(sg_cpu->cpu);
        unsigned long util = cpu_util_cfs(rq);
-       unsigned long max = arch_scale_cpu_capacity(NULL, sg_cpu->cpu);
+       unsigned long max = arch_scale_cpu_capacity(sg_cpu->cpu);
 
        sg_cpu->max = max;
        sg_cpu->bw_dl = cpu_bw_dl(rq);
index c1ef308610685a67f1bf27d3fb52f42881b21316..8b5bb2ac16e22ba2de4ecf71ee6e38e1e3a0b75d 100644 (file)
@@ -1195,7 +1195,7 @@ static void update_curr_dl(struct rq *rq)
                                                 &curr->dl);
        } else {
                unsigned long scale_freq = arch_scale_freq_capacity(cpu);
-               unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+               unsigned long scale_cpu = arch_scale_cpu_capacity(cpu);
 
                scaled_delta_exec = cap_scale(delta_exec, scale_freq);
                scaled_delta_exec = cap_scale(scaled_delta_exec, scale_cpu);
index 3c11dcdedcbc6121df548088f853be0c1360dd77..4f8754157763c1ae491ece1a6488c97928eca258 100644 (file)
@@ -764,7 +764,7 @@ void post_init_entity_util_avg(struct task_struct *p)
        struct sched_entity *se = &p->se;
        struct cfs_rq *cfs_rq = cfs_rq_of(se);
        struct sched_avg *sa = &se->avg;
-       long cpu_scale = arch_scale_cpu_capacity(NULL, cpu_of(rq_of(cfs_rq)));
+       long cpu_scale = arch_scale_cpu_capacity(cpu_of(rq_of(cfs_rq)));
        long cap = (long)(cpu_scale - cfs_rq->avg.util_avg) / 2;
 
        if (cap > 0) {
@@ -7646,7 +7646,7 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds)
 static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu)
 {
        struct rq *rq = cpu_rq(cpu);
-       unsigned long max = arch_scale_cpu_capacity(sd, cpu);
+       unsigned long max = arch_scale_cpu_capacity(cpu);
        unsigned long used, free;
        unsigned long irq;
 
@@ -7671,7 +7671,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
        unsigned long capacity = scale_rt_capacity(sd, cpu);
        struct sched_group *sdg = sd->groups;
 
-       cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(sd, cpu);
+       cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(cpu);
 
        if (!capacity)
                capacity = 1;
index befce29bd8823fbee6de38d868306fdebe3c07ce..42ea66b07b1d6c45a733bd168ecd062af9e929fd 100644 (file)
@@ -366,7 +366,7 @@ int update_irq_load_avg(struct rq *rq, u64 running)
         * reflect the real amount of computation
         */
        running = cap_scale(running, arch_scale_freq_capacity(cpu_of(rq)));
-       running = cap_scale(running, arch_scale_cpu_capacity(NULL, cpu_of(rq)));
+       running = cap_scale(running, arch_scale_cpu_capacity(cpu_of(rq)));
 
        /*
         * We know the time that has been used by interrupt since last update
index 7489d5f56960a42df6ab182e55ab988ea5d9ce81..afff644da06500b4b817925e8f35824b8b69d0c5 100644 (file)
@@ -79,7 +79,7 @@ static inline void update_rq_clock_pelt(struct rq *rq, s64 delta)
         * Scale the elapsed time to reflect the real amount of
         * computation
         */
-       delta = cap_scale(delta, arch_scale_cpu_capacity(NULL, cpu_of(rq)));
+       delta = cap_scale(delta, arch_scale_cpu_capacity(cpu_of(rq)));
        delta = cap_scale(delta, arch_scale_freq_capacity(cpu_of(rq)));
 
        rq->clock_pelt += delta;
index b08dee29ef5e834761e0f9254c7d5e89a7888fee..e58ab597ec88ffcbd611db232391b4da21c22313 100644 (file)
@@ -2248,7 +2248,7 @@ unsigned long schedutil_freq_util(int cpu, unsigned long util_cfs,
 
 static inline unsigned long schedutil_energy_util(int cpu, unsigned long cfs)
 {
-       unsigned long max = arch_scale_cpu_capacity(NULL, cpu);
+       unsigned long max = arch_scale_cpu_capacity(cpu);
 
        return schedutil_freq_util(cpu, cfs, max, ENERGY_UTIL);
 }
index 63184cf0d0d7156a5c09deb68a91dae5f603e7ec..f751ce0b783e57eff53f4d5feb73be1859d05cd6 100644 (file)
@@ -1874,10 +1874,10 @@ static struct sched_domain_topology_level
        unsigned long cap;
 
        /* Is there any asymmetry? */
-       cap = arch_scale_cpu_capacity(NULL, cpumask_first(cpu_map));
+       cap = arch_scale_cpu_capacity(cpumask_first(cpu_map));
 
        for_each_cpu(i, cpu_map) {
-               if (arch_scale_cpu_capacity(NULL, i) != cap) {
+               if (arch_scale_cpu_capacity(i) != cap) {
                        asym = true;
                        break;
                }
@@ -1892,7 +1892,7 @@ static struct sched_domain_topology_level
         * to everyone.
         */
        for_each_cpu(i, cpu_map) {
-               unsigned long max_capacity = arch_scale_cpu_capacity(NULL, i);
+               unsigned long max_capacity = arch_scale_cpu_capacity(i);
                int tl_id = 0;
 
                for_each_sd_topology(tl) {
@@ -1902,7 +1902,7 @@ static struct sched_domain_topology_level
                        for_each_cpu_and(j, tl->mask(i), cpu_map) {
                                unsigned long capacity;
 
-                               capacity = arch_scale_cpu_capacity(NULL, j);
+                               capacity = arch_scale_cpu_capacity(j);
 
                                if (capacity <= max_capacity)
                                        continue;