mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
sched/debug: Remove obsolete init_schedstats()
Revert commit4698f88c06
("sched/debug: Fix 'schedstats=enable' cmdline option"). After commit6041186a32
("init: initialize jump labels before command line option parsing") we can rely on jump label infra being ready for use when setup_schedstats() is called. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20210602112108.1709635-1-eric.dumazet@gmail.com
This commit is contained in:
parent
a9e906b71f
commit
1faa491a49
@ -4009,7 +4009,6 @@ int sysctl_numa_balancing(struct ctl_table *table, int write,
|
||||
#ifdef CONFIG_SCHEDSTATS
|
||||
|
||||
DEFINE_STATIC_KEY_FALSE(sched_schedstats);
|
||||
static bool __initdata __sched_schedstats = false;
|
||||
|
||||
static void set_schedstats(bool enabled)
|
||||
{
|
||||
@ -4033,16 +4032,11 @@ static int __init setup_schedstats(char *str)
|
||||
if (!str)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* This code is called before jump labels have been set up, so we can't
|
||||
* change the static branch directly just yet. Instead set a temporary
|
||||
* variable so init_schedstats() can do it later.
|
||||
*/
|
||||
if (!strcmp(str, "enable")) {
|
||||
__sched_schedstats = true;
|
||||
set_schedstats(true);
|
||||
ret = 1;
|
||||
} else if (!strcmp(str, "disable")) {
|
||||
__sched_schedstats = false;
|
||||
set_schedstats(false);
|
||||
ret = 1;
|
||||
}
|
||||
out:
|
||||
@ -4053,11 +4047,6 @@ static int __init setup_schedstats(char *str)
|
||||
}
|
||||
__setup("schedstats=", setup_schedstats);
|
||||
|
||||
static void __init init_schedstats(void)
|
||||
{
|
||||
set_schedstats(__sched_schedstats);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROC_SYSCTL
|
||||
int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
@ -4079,8 +4068,6 @@ int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
|
||||
return err;
|
||||
}
|
||||
#endif /* CONFIG_PROC_SYSCTL */
|
||||
#else /* !CONFIG_SCHEDSTATS */
|
||||
static inline void init_schedstats(void) {}
|
||||
#endif /* CONFIG_SCHEDSTATS */
|
||||
|
||||
/*
|
||||
@ -9089,8 +9076,6 @@ void __init sched_init(void)
|
||||
#endif
|
||||
init_sched_fair_class();
|
||||
|
||||
init_schedstats();
|
||||
|
||||
psi_init();
|
||||
|
||||
init_uclamp();
|
||||
|
Loading…
Reference in New Issue
Block a user