Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269174
b: refs/heads/master
c: 6eb57e0
h: refs/heads/master
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Oct 6, 2011
1 parent 91a071e commit 4c5f8ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 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: ca38062e57e97791c2f62e3dbd06caf3ebb5721c
refs/heads/master: 6eb57e0d65ebd99a71d435dc96d83e725752eef8
8 changes: 5 additions & 3 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ struct rq {

unsigned long cpu_power;

unsigned char idle_at_tick;
unsigned char idle_balance;
/* For active balancing */
int post_schedule;
int active_balance;
Expand Down Expand Up @@ -2751,8 +2751,10 @@ 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() && !need_resched())) {
this_rq()->idle_balance = 1;
raise_softirq_irqoff(SCHED_SOFTIRQ);
}
irq_exit();
}

Expand Down Expand Up @@ -4247,7 +4249,7 @@ void scheduler_tick(void)
perf_event_task_tick();

#ifdef CONFIG_SMP
rq->idle_at_tick = idle_cpu(cpu);
rq->idle_balance = idle_cpu(cpu);
trigger_load_balance(rq, cpu);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -4676,7 +4676,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
if (time_before(now, nohz.next_balance))
return 0;

if (rq->idle_at_tick)
if (idle_cpu(cpu))
return 0;

first_pick_cpu = atomic_read(&nohz.first_pick_cpu);
Expand Down Expand Up @@ -4712,7 +4712,7 @@ static void run_rebalance_domains(struct softirq_action *h)
{
int this_cpu = smp_processor_id();
struct rq *this_rq = cpu_rq(this_cpu);
enum cpu_idle_type idle = this_rq->idle_at_tick ?
enum cpu_idle_type idle = this_rq->idle_balance ?
CPU_IDLE : CPU_NOT_IDLE;

rebalance_domains(this_cpu, idle);
Expand Down

0 comments on commit 4c5f8ee

Please sign in to comment.