History

sched/debug: Remove obsolete init_schedstats()

Revert commit 4698f88c06b8 ("sched/debug: Fix 'schedstats=enable' cmdline option"). After commit 6041186a3258 ("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.

Eric Dumazet committed 5 years ago

Commit 1faa4911 parent a9e906b1 file · +2 −17Browse files

Unified · Split

kernel/sched/core.c+2−17
@@ -4009,7 +4009,6 @@ int sysctl_numa_balancing(struct ctl_table *table, int write, · 4008 unmodified lines
40094009 #ifdef CONFIG_SCHEDSTATS
40104010
40114011 DEFINE_STATIC_KEY_FALSE(sched_schedstats);
4012−static bool __initdata __sched_schedstats = false;
40134012
40144013 static void set_schedstats(bool enabled)
40154014 {
@@ -4033,16 +4032,11 @@ static int __init setup_schedstats(char *str) · 17 unmodified lines
40334032 if (!str)
40344033 goto out;
40354034
4036− /*
4037− * This code is called before jump labels have been set up, so we can't
4038− * change the static branch directly just yet. Instead set a temporary
4039− * variable so init_schedstats() can do it later.
4040− */
40414035 if (!strcmp(str, "enable")) {
4042− __sched_schedstats = true;
4036+ set_schedstats(true);
40434037 ret = 1;
40444038 } else if (!strcmp(str, "disable")) {
4045− __sched_schedstats = false;
4039+ set_schedstats(false);
40464040 ret = 1;
40474041 }
40484042 out:
@@ -4053,11 +4047,6 @@ out: · 4 unmodified lines
40534047 }
40544048 __setup("schedstats=", setup_schedstats);
40554049
4056−static void __init init_schedstats(void)
4057−{
4058− set_schedstats(__sched_schedstats);
4059−}
4060−
40614050 #ifdef CONFIG_PROC_SYSCTL
40624051 int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
40634052 size_t *lenp, loff_t *ppos)
@@ -4079,8 +4068,6 @@ int sysctl_schedstats(struct ctl_table *table, int write, void *buffer, · 15 unmodified lines
40794068 return err;
40804069 }
40814070 #endif /* CONFIG_PROC_SYSCTL */
4082−#else /* !CONFIG_SCHEDSTATS */
4083−static inline void init_schedstats(void) {}
40844071 #endif /* CONFIG_SCHEDSTATS */
40854072
40864073 /*
@@ -9089,8 +9076,6 @@ void __init sched_init(void) · 5002 unmodified lines
90899076 #endif
90909077 init_sched_fair_class();
90919078
9092− init_schedstats();
9093−
90949079 psi_init();
90959080
90969081 init_uclamp();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t