Skip to content

Commit 5d4dfdd

Browse files
Nicolas Pitreingomolnar
authored andcommitted
sched: Rename capacity related flags
It is better not to think about compute capacity as being equivalent to "CPU power". The upcoming "power aware" scheduler work may create confusion with the notion of energy consumption if "power" is used too liberally. Let's rename the following feature flags since they do relate to capacity: SD_SHARE_CPUPOWER -> SD_SHARE_CPUCAPACITY ARCH_POWER -> ARCH_CAPACITY NONTASK_POWER -> NONTASK_CAPACITY Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Morten Rasmussen <morten.rasmussen@arm.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: linaro-kernel@lists.linaro.org Cc: Andy Fleming <afleming@freescale.com> Cc: Anton Blanchard <anton@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Cc: Toshi Kani <toshi.kani@hp.com> Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/n/tip-e93lpnxb87owfievqatey6b5@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent ca8ce3d commit 5d4dfdd

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎arch/powerpc/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ int setup_profiling_timer(unsigned int multiplier)
770770
/* cpumask of CPUs with asymetric SMT dependancy */
771771
static const int powerpc_smt_flags(void)
772772
{
773-
int flags = SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES;
773+
int flags = SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES;
774774

775775
if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
776776
printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");

‎include/linux/sched.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ enum cpu_idle_type {
869869
#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */
870870
#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */
871871
#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */
872-
#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */
872+
#define SD_SHARE_CPUCAPACITY 0x0080 /* Domain members share cpu power */
873873
#define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */
874874
#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
875875
#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
@@ -881,7 +881,7 @@ enum cpu_idle_type {
881881
#ifdef CONFIG_SCHED_SMT
882882
static inline const int cpu_smt_flags(void)
883883
{
884-
return SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES;
884+
return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES;
885885
}
886886
#endif
887887

‎kernel/sched/core.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
872872
rq->clock_task += delta;
873873

874874
#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
875-
if ((irq_delta + steal) && sched_feat(NONTASK_POWER))
875+
if ((irq_delta + steal) && sched_feat(NONTASK_CAPACITY))
876876
sched_rt_avg_update(rq, irq_delta + steal);
877877
#endif
878878
}
@@ -5309,7 +5309,7 @@ static int sd_degenerate(struct sched_domain *sd)
53095309
SD_BALANCE_NEWIDLE |
53105310
SD_BALANCE_FORK |
53115311
SD_BALANCE_EXEC |
5312-
SD_SHARE_CPUPOWER |
5312+
SD_SHARE_CPUCAPACITY |
53135313
SD_SHARE_PKG_RESOURCES |
53145314
SD_SHARE_POWERDOMAIN)) {
53155315
if (sd->groups != sd->groups->next)
@@ -5340,7 +5340,7 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
53405340
SD_BALANCE_NEWIDLE |
53415341
SD_BALANCE_FORK |
53425342
SD_BALANCE_EXEC |
5343-
SD_SHARE_CPUPOWER |
5343+
SD_SHARE_CPUCAPACITY |
53445344
SD_SHARE_PKG_RESOURCES |
53455345
SD_PREFER_SIBLING |
53465346
SD_SHARE_POWERDOMAIN);
@@ -5947,7 +5947,7 @@ static int sched_domains_curr_level;
59475947
/*
59485948
* SD_flags allowed in topology descriptions.
59495949
*
5950-
* SD_SHARE_CPUPOWER - describes SMT topologies
5950+
* SD_SHARE_CPUCAPACITY - describes SMT topologies
59515951
* SD_SHARE_PKG_RESOURCES - describes shared caches
59525952
* SD_NUMA - describes NUMA topologies
59535953
* SD_SHARE_POWERDOMAIN - describes shared power domain
@@ -5956,7 +5956,7 @@ static int sched_domains_curr_level;
59565956
* SD_ASYM_PACKING - describes SMT quirks
59575957
*/
59585958
#define TOPOLOGY_SD_FLAGS \
5959-
(SD_SHARE_CPUPOWER | \
5959+
(SD_SHARE_CPUCAPACITY | \
59605960
SD_SHARE_PKG_RESOURCES | \
59615961
SD_NUMA | \
59625962
SD_ASYM_PACKING | \
@@ -6002,7 +6002,7 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
60026002
| 1*SD_BALANCE_FORK
60036003
| 0*SD_BALANCE_WAKE
60046004
| 1*SD_WAKE_AFFINE
6005-
| 0*SD_SHARE_CPUPOWER
6005+
| 0*SD_SHARE_CPUCAPACITY
60066006
| 0*SD_SHARE_PKG_RESOURCES
60076007
| 0*SD_SERIALIZE
60086008
| 0*SD_PREFER_SIBLING
@@ -6024,7 +6024,7 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
60246024
* Convert topological properties into behaviour.
60256025
*/
60266026

6027-
if (sd->flags & SD_SHARE_CPUPOWER) {
6027+
if (sd->flags & SD_SHARE_CPUCAPACITY) {
60286028
sd->imbalance_pct = 110;
60296029
sd->smt_gain = 1178; /* ~15% */
60306030

‎kernel/sched/fair.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,8 +5672,8 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
56725672
unsigned long capacity = SCHED_CAPACITY_SCALE;
56735673
struct sched_group *sdg = sd->groups;
56745674

5675-
if ((sd->flags & SD_SHARE_CPUPOWER) && weight > 1) {
5676-
if (sched_feat(ARCH_POWER))
5675+
if ((sd->flags & SD_SHARE_CPUCAPACITY) && weight > 1) {
5676+
if (sched_feat(ARCH_CAPACITY))
56775677
capacity *= arch_scale_smt_capacity(sd, cpu);
56785678
else
56795679
capacity *= default_scale_smt_capacity(sd, cpu);
@@ -5683,7 +5683,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
56835683

56845684
sdg->sgc->capacity_orig = capacity;
56855685

5686-
if (sched_feat(ARCH_POWER))
5686+
if (sched_feat(ARCH_CAPACITY))
56875687
capacity *= arch_scale_freq_capacity(sd, cpu);
56885688
else
56895689
capacity *= default_scale_capacity(sd, cpu);
@@ -5782,7 +5782,7 @@ fix_small_capacity(struct sched_domain *sd, struct sched_group *group)
57825782
/*
57835783
* Only siblings can have significantly less than SCHED_CAPACITY_SCALE
57845784
*/
5785-
if (!(sd->flags & SD_SHARE_CPUPOWER))
5785+
if (!(sd->flags & SD_SHARE_CPUCAPACITY))
57865786
return 0;
57875787

57885788
/*

‎kernel/sched/features.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ SCHED_FEAT(CACHE_HOT_BUDDY, true)
3737
SCHED_FEAT(WAKEUP_PREEMPTION, true)
3838

3939
/*
40-
* Use arch dependent cpu power functions
40+
* Use arch dependent cpu capacity functions
4141
*/
42-
SCHED_FEAT(ARCH_POWER, true)
42+
SCHED_FEAT(ARCH_CAPACITY, true)
4343

4444
SCHED_FEAT(HRTICK, false)
4545
SCHED_FEAT(DOUBLE_TICK, false)
4646
SCHED_FEAT(LB_BIAS, true)
4747

4848
/*
49-
* Decrement CPU power based on time not spent running tasks
49+
* Decrement CPU capacity based on time not spent running tasks
5050
*/
51-
SCHED_FEAT(NONTASK_POWER, true)
51+
SCHED_FEAT(NONTASK_CAPACITY, true)
5252

5353
/*
5454
* Queue remote wakeups on the target CPU and process them

0 commit comments

Comments
 (0)