Skip to content

Commit 57903f7

Browse files
author
Ingo Molnar
committed
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
1 parent f7d2728 commit 57903f7

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
128128
*/
129129
#define SCHED_FEAT(name, enabled) \
130130
(1UL << __SCHED_FEAT_##name) * enabled |
131-
const_debug unsigned int sysctl_sched_features =
131+
__read_mostly unsigned int sysctl_sched_features =
132132
#include "features.h"
133133
0;
134134
#undef SCHED_FEAT
@@ -148,7 +148,7 @@ __read_mostly int sysctl_resched_latency_warn_once = 1;
148148
* Number of tasks to iterate in a single balance run.
149149
* Limited because this is done with IRQs disabled.
150150
*/
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;
152152

153153
__read_mostly int scheduler_running;
154154

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG;
7979
unsigned int sysctl_sched_base_slice = 700000ULL;
8080
static unsigned int normalized_sysctl_sched_base_slice = 700000ULL;
8181

82-
const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
82+
__read_mostly unsigned int sysctl_sched_migration_cost = 500000UL;
8383

8484
static int __init setup_sched_thermal_decay_shift(char *str)
8585
{

kernel/sched/sched.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,13 +2194,8 @@ static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
21942194
}
21952195

21962196
/*
2197-
* Tunables that become constants when CONFIG_SCHED_DEBUG is off:
2197+
* Tunables:
21982198
*/
2199-
#ifdef CONFIG_SCHED_DEBUG
2200-
# define const_debug __read_mostly
2201-
#else
2202-
# define const_debug const
2203-
#endif
22042199

22052200
#define SCHED_FEAT(name, enabled) \
22062201
__SCHED_FEAT_##name ,
@@ -2218,7 +2213,7 @@ enum {
22182213
* To support run-time toggling of sched features, all the translation units
22192214
* (but core.c) reference the sysctl_sched_features defined in core.c.
22202215
*/
2221-
extern const_debug unsigned int sysctl_sched_features;
2216+
extern __read_mostly unsigned int sysctl_sched_features;
22222217

22232218
#ifdef CONFIG_JUMP_LABEL
22242219

@@ -2249,7 +2244,7 @@ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR];
22492244
*/
22502245
#define SCHED_FEAT(name, enabled) \
22512246
(1UL << __SCHED_FEAT_##name) * enabled |
2252-
static const_debug __maybe_unused unsigned int sysctl_sched_features =
2247+
static __read_mostly __maybe_unused unsigned int sysctl_sched_features =
22532248
#include "features.h"
22542249
0;
22552250
#undef SCHED_FEAT
@@ -2837,8 +2832,8 @@ extern void wakeup_preempt(struct rq *rq, struct task_struct *p, int flags);
28372832
# define SCHED_NR_MIGRATE_BREAK 32
28382833
#endif
28392834

2840-
extern const_debug unsigned int sysctl_sched_nr_migrate;
2841-
extern const_debug unsigned int sysctl_sched_migration_cost;
2835+
extern __read_mostly unsigned int sysctl_sched_nr_migrate;
2836+
extern __read_mostly unsigned int sysctl_sched_migration_cost;
28422837

28432838
extern unsigned int sysctl_sched_base_slice;
28442839

0 commit comments

Comments
 (0)