Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/debug: Make 'const_debug' tunables unconditional __read_mostly

With CONFIG_SCHED_DEBUG becoming unconditional, remove the
extra 'const_debug' indirection towards __read_mostly.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250317104257.3496611-3-mingo@kernel.org

+8 -13
+2 -2
kernel/sched/core.c
··· 128 128 */ 129 129 #define SCHED_FEAT(name, enabled) \ 130 130 (1UL << __SCHED_FEAT_##name) * enabled | 131 - const_debug unsigned int sysctl_sched_features = 131 + __read_mostly unsigned int sysctl_sched_features = 132 132 #include "features.h" 133 133 0; 134 134 #undef SCHED_FEAT ··· 148 148 * Number of tasks to iterate in a single balance run. 149 149 * Limited because this is done with IRQs disabled. 150 150 */ 151 - const_debug unsigned int sysctl_sched_nr_migrate = SCHED_NR_MIGRATE_BREAK; 151 + __read_mostly unsigned int sysctl_sched_nr_migrate = SCHED_NR_MIGRATE_BREAK; 152 152 153 153 __read_mostly int scheduler_running; 154 154
+1 -1
kernel/sched/fair.c
··· 79 79 unsigned int sysctl_sched_base_slice = 700000ULL; 80 80 static unsigned int normalized_sysctl_sched_base_slice = 700000ULL; 81 81 82 - const_debug unsigned int sysctl_sched_migration_cost = 500000UL; 82 + __read_mostly unsigned int sysctl_sched_migration_cost = 500000UL; 83 83 84 84 static int __init setup_sched_thermal_decay_shift(char *str) 85 85 {
+5 -10
kernel/sched/sched.h
··· 2194 2194 } 2195 2195 2196 2196 /* 2197 - * Tunables that become constants when CONFIG_SCHED_DEBUG is off: 2197 + * Tunables: 2198 2198 */ 2199 - #ifdef CONFIG_SCHED_DEBUG 2200 - # define const_debug __read_mostly 2201 - #else 2202 - # define const_debug const 2203 - #endif 2204 2199 2205 2200 #define SCHED_FEAT(name, enabled) \ 2206 2201 __SCHED_FEAT_##name , ··· 2213 2218 * To support run-time toggling of sched features, all the translation units 2214 2219 * (but core.c) reference the sysctl_sched_features defined in core.c. 2215 2220 */ 2216 - extern const_debug unsigned int sysctl_sched_features; 2221 + extern __read_mostly unsigned int sysctl_sched_features; 2217 2222 2218 2223 #ifdef CONFIG_JUMP_LABEL 2219 2224 ··· 2244 2249 */ 2245 2250 #define SCHED_FEAT(name, enabled) \ 2246 2251 (1UL << __SCHED_FEAT_##name) * enabled | 2247 - static const_debug __maybe_unused unsigned int sysctl_sched_features = 2252 + static __read_mostly __maybe_unused unsigned int sysctl_sched_features = 2248 2253 #include "features.h" 2249 2254 0; 2250 2255 #undef SCHED_FEAT ··· 2832 2837 # define SCHED_NR_MIGRATE_BREAK 32 2833 2838 #endif 2834 2839 2835 - extern const_debug unsigned int sysctl_sched_nr_migrate; 2836 - extern const_debug unsigned int sysctl_sched_migration_cost; 2840 + extern __read_mostly unsigned int sysctl_sched_nr_migrate; 2841 + extern __read_mostly unsigned int sysctl_sched_migration_cost; 2837 2842 2838 2843 extern unsigned int sysctl_sched_base_slice; 2839 2844