Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377260
b: refs/heads/master
c: 873b4c6
h: refs/heads/master
v: v3
  • Loading branch information
Vincent Guittot authored and Ingo Molnar committed Jun 19, 2013
1 parent e4d6912 commit a44e22d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0bc225d0e5de887340d4d92a8c594ef0f60d412
refs/heads/master: 873b4c65b519fd769940eb281f77848227d4e5c1
21 changes: 17 additions & 4 deletions trunk/kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,19 @@ void wake_up_nohz_cpu(int cpu)
static inline bool got_nohz_idle_kick(void)
{
int cpu = smp_processor_id();
return idle_cpu(cpu) && test_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu));

if (!test_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu)))
return false;

if (idle_cpu(cpu) && !need_resched())
return true;

/*
* We can't run Idle Load Balance on this CPU for this time so we
* cancel it and clear NOHZ_BALANCE_KICK
*/
clear_bit(NOHZ_BALANCE_KICK, nohz_flags(cpu));
return false;
}

#else /* CONFIG_NO_HZ_COMMON */
Expand Down Expand Up @@ -1393,8 +1405,9 @@ static void sched_ttwu_pending(void)

void scheduler_ipi(void)
{
if (llist_empty(&this_rq()->wake_list) && !got_nohz_idle_kick()
&& !tick_nohz_full_cpu(smp_processor_id()))
if (llist_empty(&this_rq()->wake_list)
&& !tick_nohz_full_cpu(smp_processor_id())
&& !got_nohz_idle_kick())
return;

/*
Expand All @@ -1417,7 +1430,7 @@ void scheduler_ipi(void)
/*
* Check if someone kicked us for doing the nohz idle load balance.
*/
if (unlikely(got_nohz_idle_kick() && !need_resched())) {
if (unlikely(got_nohz_idle_kick())) {
this_rq()->idle_balance = 1;
raise_softirq_irqoff(SCHED_SOFTIRQ);
}
Expand Down

0 comments on commit a44e22d

Please sign in to comment.