Skip to content

Commit 8dde191

Browse files
committed
Merge tag 'sched-urgent-2024-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: - Fix a sched_balance_newidle setting bug - Fix bug in the setting of /sys/fs/cgroup/test/cpu.max.burst - Fix variable-shadowing build warning - Extend sched-domains debug output - Fix documentation - Fix comments * tag 'sched-urgent-2024-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/core: Fix incorrect initialization of the 'burst' parameter in cpu_max_write() sched/fair: Remove stale FREQUENCY_UTIL comment sched/fair: Fix initial util_avg calculation docs: cgroup-v1: Clarify that domain levels are system-specific sched/debug: Dump domains' level sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level arch/topology: Fix variable naming to avoid shadowing
2 parents fe0d43f + 49217ea commit 8dde191

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

Documentation/admin-guide/cgroup-v1/cpusets.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ on the next tick. For some applications in special situation, waiting
568568

569569
The 'cpuset.sched_relax_domain_level' file allows you to request changing
570570
this searching range as you like. This file takes int value which
571-
indicates size of searching range in levels ideally as follows,
571+
indicates size of searching range in levels approximately as follows,
572572
otherwise initial value -1 that indicates the cpuset has no request.
573573

574574
====== ===========================================================
@@ -581,6 +581,11 @@ otherwise initial value -1 that indicates the cpuset has no request.
581581
5 search system wide [on NUMA system]
582582
====== ===========================================================
583583

584+
Not all levels can be present and values can change depending on the
585+
system architecture and kernel configuration. Check
586+
/sys/kernel/debug/sched/domains/cpu*/domain*/ for system-specific
587+
details.
588+
584589
The system default is architecture dependent. The system default
585590
can be changed using the relax_domain_level= boot parameter.
586591

drivers/base/arch_topology.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ DEFINE_PER_CPU(unsigned long, hw_pressure);
179179
void topology_update_hw_pressure(const struct cpumask *cpus,
180180
unsigned long capped_freq)
181181
{
182-
unsigned long max_capacity, capacity, hw_pressure;
182+
unsigned long max_capacity, capacity, pressure;
183183
u32 max_freq;
184184
int cpu;
185185

@@ -196,12 +196,12 @@ void topology_update_hw_pressure(const struct cpumask *cpus,
196196
else
197197
capacity = mult_frac(max_capacity, capped_freq, max_freq);
198198

199-
hw_pressure = max_capacity - capacity;
199+
pressure = max_capacity - capacity;
200200

201-
trace_hw_pressure_update(cpu, hw_pressure);
201+
trace_hw_pressure_update(cpu, pressure);
202202

203203
for_each_cpu(cpu, cpus)
204-
WRITE_ONCE(per_cpu(hw_pressure, cpu), hw_pressure);
204+
WRITE_ONCE(per_cpu(hw_pressure, cpu), pressure);
205205
}
206206
EXPORT_SYMBOL_GPL(topology_update_hw_pressure);
207207

kernel/cgroup/cpuset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2941,7 +2941,7 @@ bool current_cpuset_is_being_rebound(void)
29412941
static int update_relax_domain_level(struct cpuset *cs, s64 val)
29422942
{
29432943
#ifdef CONFIG_SMP
2944-
if (val < -1 || val >= sched_domain_level_max)
2944+
if (val < -1 || val > sched_domain_level_max + 1)
29452945
return -EINVAL;
29462946
#endif
29472947

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11401,7 +11401,7 @@ static ssize_t cpu_max_write(struct kernfs_open_file *of,
1140111401
{
1140211402
struct task_group *tg = css_tg(of_css(of));
1140311403
u64 period = tg_get_cfs_period(tg);
11404-
u64 burst = tg_get_cfs_burst(tg);
11404+
u64 burst = tg->cfs_bandwidth.burst;
1140511405
u64 quota;
1140611406
int ret;
1140711407

kernel/sched/debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ static void register_sd(struct sched_domain *sd, struct dentry *parent)
425425

426426
debugfs_create_file("flags", 0444, parent, &sd->flags, &sd_flags_fops);
427427
debugfs_create_file("groups_flags", 0444, parent, &sd->groups->flags, &sd_flags_fops);
428+
debugfs_create_u32("level", 0444, parent, (u32 *)&sd->level);
428429
}
429430

430431
void update_sched_domain_debugfs(void)

kernel/sched/fair.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,8 @@ void init_entity_runnable_average(struct sched_entity *se)
10301030
* With new tasks being created, their initial util_avgs are extrapolated
10311031
* based on the cfs_rq's current util_avg:
10321032
*
1033-
* util_avg = cfs_rq->util_avg / (cfs_rq->load_avg + 1) * se.load.weight
1033+
* util_avg = cfs_rq->avg.util_avg / (cfs_rq->avg.load_avg + 1)
1034+
* * se_weight(se)
10341035
*
10351036
* However, in many cases, the above util_avg does not give a desired
10361037
* value. Moreover, the sum of the util_avgs may be divergent, such
@@ -1077,7 +1078,7 @@ void post_init_entity_util_avg(struct task_struct *p)
10771078

10781079
if (cap > 0) {
10791080
if (cfs_rq->avg.util_avg != 0) {
1080-
sa->util_avg = cfs_rq->avg.util_avg * se->load.weight;
1081+
sa->util_avg = cfs_rq->avg.util_avg * se_weight(se);
10811082
sa->util_avg /= (cfs_rq->avg.load_avg + 1);
10821083

10831084
if (sa->util_avg > cap)
@@ -7898,8 +7899,8 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
78987899
* Performance domain frequency: utilization clamping
78997900
* must be considered since it affects the selection
79007901
* of the performance domain frequency.
7901-
* NOTE: in case RT tasks are running, by default the
7902-
* FREQUENCY_UTIL's utilization can be max OPP.
7902+
* NOTE: in case RT tasks are running, by default the min
7903+
* utilization can be max OPP.
79037904
*/
79047905
eff_util = effective_cpu_util(cpu, util, &min, &max);
79057906

kernel/sched/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ static void set_domain_attribute(struct sched_domain *sd,
14741474
} else
14751475
request = attr->relax_domain_level;
14761476

1477-
if (sd->level > request) {
1477+
if (sd->level >= request) {
14781478
/* Turn off idle balance on this domain: */
14791479
sd->flags &= ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE);
14801480
}

0 commit comments

Comments
 (0)