diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index e0fa739a441b..af5cd1b2d03e 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -331,6 +331,13 @@ static DEFINE_PER_CPU(struct rt_rq, init_rt_rq) ____cacheline_aligned_in_smp; | |||
331 | */ | 331 | */ |
332 | static DEFINE_SPINLOCK(task_group_lock); | 332 | static DEFINE_SPINLOCK(task_group_lock); |
333 | 333 | ||
334 | #ifdef CONFIG_SMP | ||
335 | static int root_task_group_empty(void) | ||
336 | { | ||
337 | return list_empty(&root_task_group.children); | ||
338 | } | ||
339 | #endif | ||
340 | |||
334 | #ifdef CONFIG_FAIR_GROUP_SCHED | 341 | #ifdef CONFIG_FAIR_GROUP_SCHED |
335 | #ifdef CONFIG_USER_SCHED | 342 | #ifdef CONFIG_USER_SCHED |
336 | # define INIT_TASK_GROUP_LOAD (2*NICE_0_LOAD) | 343 | # define INIT_TASK_GROUP_LOAD (2*NICE_0_LOAD) |
@@ -391,6 +398,13 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) | |||
391 | 398 | ||
392 | #else | 399 | #else |
393 | 400 | ||
401 | #ifdef CONFIG_SMP | ||
402 | static int root_task_group_empty(void) | ||
403 | { | ||
404 | return 1; | ||
405 | } | ||
406 | #endif | ||
407 | |||
394 | static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { } | 408 | static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { } |
395 | static inline struct task_group *task_group(struct task_struct *p) | 409 | static inline struct task_group *task_group(struct task_struct *p) |
396 | { | 410 | { |
@@ -2318,7 +2332,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) | |||
2318 | sync = 0; | 2332 | sync = 0; |
2319 | 2333 | ||
2320 | #ifdef CONFIG_SMP | 2334 | #ifdef CONFIG_SMP |
2321 | if (sched_feat(LB_WAKEUP_UPDATE)) { | 2335 | if (sched_feat(LB_WAKEUP_UPDATE) && !root_task_group_empty()) { |
2322 | struct sched_domain *sd; | 2336 | struct sched_domain *sd; |
2323 | 2337 | ||
2324 | this_cpu = raw_smp_processor_id(); | 2338 | this_cpu = raw_smp_processor_id(); |