Skip to content

Commit 765d0af

Browse files
vingu-linaroIngo Molnar
authored andcommitted
sched/topology: Remove the ::smt_gain field from 'struct sched_domain'
::smt_gain is used to compute the capacity of CPUs of a SMT core with the constraint 1 < ::smt_gain < 2 in order to be able to compute number of CPUs per core. The field has_free_capacity of struct numa_stat, which was the last user of this computation of number of CPUs per core, has been removed by: 2d4056f ("sched/numa: Remove numa_has_capacity()") We can now remove this constraint on core capacity and use the defautl value SCHED_CAPACITY_SCALE for SMT CPUs. With this remove, SCHED_CAPACITY_SCALE becomes the maximum compute capacity of CPUs on every systems. This should help to simplify some code and remove fields like rd->max_cpu_capacity Furthermore, arch_scale_cpu_capacity() is used with a NULL sd in several other places in the code when it wants the capacity of a CPUs to scale some metrics like in pelt, deadline or schedutil. In case on SMT, the value returned is not the capacity of SMT CPUs but default SCHED_CAPACITY_SCALE. So remove it. Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent dfcb245 commit 765d0af

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

include/linux/sched/topology.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ struct sched_domain {
8989
unsigned int newidle_idx;
9090
unsigned int wake_idx;
9191
unsigned int forkexec_idx;
92-
unsigned int smt_gain;
9392

9493
int nohz_idle; /* NOHZ IDLE status */
9594
int flags; /* See SD_* */

kernel/sched/sched.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,9 +1864,6 @@ unsigned long arch_scale_freq_capacity(int cpu)
18641864
static __always_inline
18651865
unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu)
18661866
{
1867-
if (sd && (sd->flags & SD_SHARE_CPUCAPACITY) && (sd->span_weight > 1))
1868-
return sd->smt_gain / sd->span_weight;
1869-
18701867
return SCHED_CAPACITY_SCALE;
18711868
}
18721869
#endif

kernel/sched/topology.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,6 @@ sd_init(struct sched_domain_topology_level *tl,
11331133

11341134
.last_balance = jiffies,
11351135
.balance_interval = sd_weight,
1136-
.smt_gain = 0,
11371136
.max_newidle_lb_cost = 0,
11381137
.next_decay_max_lb_cost = jiffies,
11391138
.child = child,
@@ -1164,7 +1163,6 @@ sd_init(struct sched_domain_topology_level *tl,
11641163

11651164
if (sd->flags & SD_SHARE_CPUCAPACITY) {
11661165
sd->imbalance_pct = 110;
1167-
sd->smt_gain = 1178; /* ~15% */
11681166

11691167
} else if (sd->flags & SD_SHARE_PKG_RESOURCES) {
11701168
sd->imbalance_pct = 117;

0 commit comments

Comments
 (0)