aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-06-20 14:18:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-20 14:18:35 -0400
commita3d5c3460a86f52ea435b3fb98be112bd18faabc (patch)
tree48a32968b569af0e0f0af1def3effa0770710fea /kernel/sched
parent86c76676cfdbf283f6131d5a2783bed3f3d490ea (diff)
parent29bb9e5a75684106a37593ad75ec75ff8312731b (diff)
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: "Two smaller fixes - plus a context tracking tracing fix that is a bit bigger" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tracing/context-tracking: Add preempt_schedule_context() for tracing sched: Fix clear NOHZ_BALANCE_KICK sched/x86: Construct all sibling maps if smt
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e1a27f918723..e8b335016c52 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -633,7 +633,19 @@ void wake_up_nohz_cpu(int cpu)
633static inline bool got_nohz_idle_kick(void) 633static inline bool got_nohz_idle_kick(void)
634{ 634{
635 int cpu = smp_processor_id(); 635 int cpu = smp_processor_id();
636 return idle_cpu(cpu) && test_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu)); 636
637 if (!test_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu)))
638 return false;
639
640 if (idle_cpu(cpu) && !need_resched())
641 return true;
642
643 /*
644 * We can't run Idle Load Balance on this CPU for this time so we
645 * cancel it and clear NOHZ_BALANCE_KICK
646 */
647 clear_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu));
648 return false;
637} 649}
638 650
639#else /* CONFIG_NO_HZ_COMMON */ 651#else /* CONFIG_NO_HZ_COMMON */
@@ -1393,8 +1405,9 @@ static void sched_ttwu_pending(void)
1393 1405
1394void scheduler_ipi(void) 1406void scheduler_ipi(void)
1395{ 1407{
1396 if (llist_empty(&this_rq()->wake_list) && !got_nohz_idle_kick() 1408 if (llist_empty(&this_rq()->wake_list)
1397 && !tick_nohz_full_cpu(smp_processor_id())) 1409 && !tick_nohz_full_cpu(smp_processor_id())
1410 && !got_nohz_idle_kick())
1398 return; 1411 return;
1399 1412
1400 /* 1413 /*
@@ -1417,7 +1430,7 @@ void scheduler_ipi(void)
1417 /* 1430 /*
1418 * Check if someone kicked us for doing the nohz idle load balance. 1431 * Check if someone kicked us for doing the nohz idle load balance.
1419 */ 1432 */
1420 if (unlikely(got_nohz_idle_kick() && !need_resched())) { 1433 if (unlikely(got_nohz_idle_kick())) {
1421 this_rq()->idle_balance = 1; 1434 this_rq()->idle_balance = 1;
1422 raise_softirq_irqoff(SCHED_SOFTIRQ); 1435 raise_softirq_irqoff(SCHED_SOFTIRQ);
1423 } 1436 }