@@ -4476,17 +4476,9 @@ static inline int util_fits_cpu(unsigned long util,
44764476 *
44774477 * For uclamp_max, we can tolerate a drop in performance level as the
44784478 * goal is to cap the task. So it's okay if it's getting less.
4479- *
4480- * In case of capacity inversion we should honour the inverted capacity
4481- * for both uclamp_min and uclamp_max all the time.
44824479 */
4483- capacity_orig = cpu_in_capacity_inversion (cpu );
4484- if (capacity_orig ) {
4485- capacity_orig_thermal = capacity_orig ;
4486- } else {
4487- capacity_orig = capacity_orig_of (cpu );
4488- capacity_orig_thermal = capacity_orig - arch_scale_thermal_pressure (cpu );
4489- }
4480+ capacity_orig = capacity_orig_of (cpu );
4481+ capacity_orig_thermal = capacity_orig - arch_scale_thermal_pressure (cpu );
44904482
44914483 /*
44924484 * We want to force a task to fit a cpu as implied by uclamp_max.
@@ -9027,82 +9019,16 @@ static unsigned long scale_rt_capacity(int cpu)
90279019
90289020static void update_cpu_capacity (struct sched_domain * sd , int cpu )
90299021{
9030- unsigned long capacity_orig = arch_scale_cpu_capacity (cpu );
90319022 unsigned long capacity = scale_rt_capacity (cpu );
90329023 struct sched_group * sdg = sd -> groups ;
9033- struct rq * rq = cpu_rq (cpu );
90349024
9035- rq -> cpu_capacity_orig = capacity_orig ;
9025+ cpu_rq ( cpu ) -> cpu_capacity_orig = arch_scale_cpu_capacity ( cpu ) ;
90369026
90379027 if (!capacity )
90389028 capacity = 1 ;
90399029
9040- rq -> cpu_capacity = capacity ;
9041-
9042- /*
9043- * Detect if the performance domain is in capacity inversion state.
9044- *
9045- * Capacity inversion happens when another perf domain with equal or
9046- * lower capacity_orig_of() ends up having higher capacity than this
9047- * domain after subtracting thermal pressure.
9048- *
9049- * We only take into account thermal pressure in this detection as it's
9050- * the only metric that actually results in *real* reduction of
9051- * capacity due to performance points (OPPs) being dropped/become
9052- * unreachable due to thermal throttling.
9053- *
9054- * We assume:
9055- * * That all cpus in a perf domain have the same capacity_orig
9056- * (same uArch).
9057- * * Thermal pressure will impact all cpus in this perf domain
9058- * equally.
9059- */
9060- if (sched_energy_enabled ()) {
9061- unsigned long inv_cap = capacity_orig - thermal_load_avg (rq );
9062- struct perf_domain * pd ;
9063-
9064- rcu_read_lock ();
9065-
9066- pd = rcu_dereference (rq -> rd -> pd );
9067- rq -> cpu_capacity_inverted = 0 ;
9068-
9069- for (; pd ; pd = pd -> next ) {
9070- struct cpumask * pd_span = perf_domain_span (pd );
9071- unsigned long pd_cap_orig , pd_cap ;
9072-
9073- /* We can't be inverted against our own pd */
9074- if (cpumask_test_cpu (cpu_of (rq ), pd_span ))
9075- continue ;
9076-
9077- cpu = cpumask_any (pd_span );
9078- pd_cap_orig = arch_scale_cpu_capacity (cpu );
9079-
9080- if (capacity_orig < pd_cap_orig )
9081- continue ;
9082-
9083- /*
9084- * handle the case of multiple perf domains have the
9085- * same capacity_orig but one of them is under higher
9086- * thermal pressure. We record it as capacity
9087- * inversion.
9088- */
9089- if (capacity_orig == pd_cap_orig ) {
9090- pd_cap = pd_cap_orig - thermal_load_avg (cpu_rq (cpu ));
9091-
9092- if (pd_cap > inv_cap ) {
9093- rq -> cpu_capacity_inverted = inv_cap ;
9094- break ;
9095- }
9096- } else if (pd_cap_orig > inv_cap ) {
9097- rq -> cpu_capacity_inverted = inv_cap ;
9098- break ;
9099- }
9100- }
9101-
9102- rcu_read_unlock ();
9103- }
9104-
9105- trace_sched_cpu_capacity_tp (rq );
9030+ cpu_rq (cpu )-> cpu_capacity = capacity ;
9031+ trace_sched_cpu_capacity_tp (cpu_rq (cpu ));
91069032
91079033 sdg -> sgc -> capacity = capacity ;
91089034 sdg -> sgc -> min_capacity = capacity ;
0 commit comments