[PATCH 12/17] sched/debug: Rename min_granularity to base_slice

From: Peter Zijlstra
Date: Tue Mar 28 2023 - 07:07:31 EST



Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
kernel/sched/debug.c | 4 ++--
kernel/sched/fair.c | 10 +++++-----
kernel/sched/sched.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)

--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -308,7 +308,7 @@ static __init int sched_init_debug(void)
debugfs_create_file("preempt", 0644, debugfs_sched, NULL, &sched_dynamic_fops);
#endif

- debugfs_create_u32("min_granularity_ns", 0644, debugfs_sched, &sysctl_sched_min_granularity);
+ debugfs_create_u32("base_slice_ns", 0644, debugfs_sched, &sysctl_sched_base_slice);

debugfs_create_u32("latency_warn_ms", 0644, debugfs_sched, &sysctl_resched_latency_warn_ms);
debugfs_create_u32("latency_warn_once", 0644, debugfs_sched, &sysctl_resched_latency_warn_once);
@@ -816,7 +816,7 @@ static void sched_debug_header(struct se
SEQ_printf(m, " .%-40s: %Ld\n", #x, (long long)(x))
#define PN(x) \
SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))
- PN(sysctl_sched_min_granularity);
+ PN(sysctl_sched_base_slice);
P(sysctl_sched_child_runs_first);
P(sysctl_sched_features);
#undef PN
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -75,8 +75,8 @@ unsigned int sysctl_sched_tunable_scalin
*
* (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
*/
-unsigned int sysctl_sched_min_granularity = 750000ULL;
-static unsigned int normalized_sysctl_sched_min_granularity = 750000ULL;
+unsigned int sysctl_sched_base_slice = 750000ULL;
+static unsigned int normalized_sysctl_sched_base_slice = 750000ULL;

/*
* After fork, child runs first. If set to 0 (default) then
@@ -237,7 +237,7 @@ static void update_sysctl(void)

#define SET_SYSCTL(name) \
(sysctl_##name = (factor) * normalized_sysctl_##name)
- SET_SYSCTL(sched_min_granularity);
+ SET_SYSCTL(sched_base_slice);
#undef SET_SYSCTL
}

@@ -882,7 +882,7 @@ int sched_update_scaling(void)

#define WRT_SYSCTL(name) \
(normalized_sysctl_##name = sysctl_##name / (factor))
- WRT_SYSCTL(sched_min_granularity);
+ WRT_SYSCTL(sched_base_slice);
#undef WRT_SYSCTL

return 0;
@@ -892,7 +892,7 @@ int sched_update_scaling(void)
long calc_latency_offset(int prio)
{
u32 weight = sched_prio_to_weight[prio];
- u64 base = sysctl_sched_min_granularity;
+ u64 base = sysctl_sched_base_slice;

return div_u64(base << SCHED_FIXEDPOINT_SHIFT, weight);
}
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2464,7 +2464,7 @@ extern const_debug unsigned int sysctl_s
extern const_debug unsigned int sysctl_sched_migration_cost;

#ifdef CONFIG_SCHED_DEBUG
-extern unsigned int sysctl_sched_min_granularity;
+extern unsigned int sysctl_sched_base_slice;
extern int sysctl_resched_latency_warn_ms;
extern int sysctl_resched_latency_warn_once;