diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
commit | af52739b922f656eb1f39016fabaabe4baeda2e2 (patch) | |
tree | 79a7aa810d0493cd0cf4adebac26d37f12e8b545 /kernel/sched/core.c | |
parent | 25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff) | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) |
Merge 4.7-rc4 into staging-next
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7f2cae4620c7..017d5394f5dc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -2253,9 +2253,11 @@ int sysctl_numa_balancing(struct ctl_table *table, int write, | |||
2253 | #endif | 2253 | #endif |
2254 | #endif | 2254 | #endif |
2255 | 2255 | ||
2256 | #ifdef CONFIG_SCHEDSTATS | ||
2257 | |||
2256 | DEFINE_STATIC_KEY_FALSE(sched_schedstats); | 2258 | DEFINE_STATIC_KEY_FALSE(sched_schedstats); |
2259 | static bool __initdata __sched_schedstats = false; | ||
2257 | 2260 | ||
2258 | #ifdef CONFIG_SCHEDSTATS | ||
2259 | static void set_schedstats(bool enabled) | 2261 | static void set_schedstats(bool enabled) |
2260 | { | 2262 | { |
2261 | if (enabled) | 2263 | if (enabled) |
@@ -2278,11 +2280,16 @@ static int __init setup_schedstats(char *str) | |||
2278 | if (!str) | 2280 | if (!str) |
2279 | goto out; | 2281 | goto out; |
2280 | 2282 | ||
2283 | /* | ||
2284 | * This code is called before jump labels have been set up, so we can't | ||
2285 | * change the static branch directly just yet. Instead set a temporary | ||
2286 | * variable so init_schedstats() can do it later. | ||
2287 | */ | ||
2281 | if (!strcmp(str, "enable")) { | 2288 | if (!strcmp(str, "enable")) { |
2282 | set_schedstats(true); | 2289 | __sched_schedstats = true; |
2283 | ret = 1; | 2290 | ret = 1; |
2284 | } else if (!strcmp(str, "disable")) { | 2291 | } else if (!strcmp(str, "disable")) { |
2285 | set_schedstats(false); | 2292 | __sched_schedstats = false; |
2286 | ret = 1; | 2293 | ret = 1; |
2287 | } | 2294 | } |
2288 | out: | 2295 | out: |
@@ -2293,6 +2300,11 @@ out: | |||
2293 | } | 2300 | } |
2294 | __setup("schedstats=", setup_schedstats); | 2301 | __setup("schedstats=", setup_schedstats); |
2295 | 2302 | ||
2303 | static void __init init_schedstats(void) | ||
2304 | { | ||
2305 | set_schedstats(__sched_schedstats); | ||
2306 | } | ||
2307 | |||
2296 | #ifdef CONFIG_PROC_SYSCTL | 2308 | #ifdef CONFIG_PROC_SYSCTL |
2297 | int sysctl_schedstats(struct ctl_table *table, int write, | 2309 | int sysctl_schedstats(struct ctl_table *table, int write, |
2298 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2310 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -2313,8 +2325,10 @@ int sysctl_schedstats(struct ctl_table *table, int write, | |||
2313 | set_schedstats(state); | 2325 | set_schedstats(state); |
2314 | return err; | 2326 | return err; |
2315 | } | 2327 | } |
2316 | #endif | 2328 | #endif /* CONFIG_PROC_SYSCTL */ |
2317 | #endif | 2329 | #else /* !CONFIG_SCHEDSTATS */ |
2330 | static inline void init_schedstats(void) {} | ||
2331 | #endif /* CONFIG_SCHEDSTATS */ | ||
2318 | 2332 | ||
2319 | /* | 2333 | /* |
2320 | * fork()/clone()-time setup: | 2334 | * fork()/clone()-time setup: |
@@ -3156,7 +3170,8 @@ static noinline void __schedule_bug(struct task_struct *prev) | |||
3156 | static inline void schedule_debug(struct task_struct *prev) | 3170 | static inline void schedule_debug(struct task_struct *prev) |
3157 | { | 3171 | { |
3158 | #ifdef CONFIG_SCHED_STACK_END_CHECK | 3172 | #ifdef CONFIG_SCHED_STACK_END_CHECK |
3159 | BUG_ON(task_stack_end_corrupted(prev)); | 3173 | if (task_stack_end_corrupted(prev)) |
3174 | panic("corrupted stack end detected inside scheduler\n"); | ||
3160 | #endif | 3175 | #endif |
3161 | 3176 | ||
3162 | if (unlikely(in_atomic_preempt_off())) { | 3177 | if (unlikely(in_atomic_preempt_off())) { |
@@ -7487,6 +7502,8 @@ void __init sched_init(void) | |||
7487 | #endif | 7502 | #endif |
7488 | init_sched_fair_class(); | 7503 | init_sched_fair_class(); |
7489 | 7504 | ||
7505 | init_schedstats(); | ||
7506 | |||
7490 | scheduler_running = 1; | 7507 | scheduler_running = 1; |
7491 | } | 7508 | } |
7492 | 7509 | ||