Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64347
b: refs/heads/master
c: f549da8
h: refs/heads/master
i:
  64345: af4b445
  64343: 2f588c8
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Aug 23, 2007
1 parent 475e314 commit 31e8efd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: f8700df7c419781efb34696de7e7f49717f8ede7
refs/heads/master: f549da848eca595abca14ebc5e1bf00fd72aa53d
14 changes: 12 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,7 @@ static inline void rebalance_domains(int cpu, enum cpu_idle_type idle)
struct sched_domain *sd;
/* Earliest time when we have to do rebalance again */
unsigned long next_balance = jiffies + 60*HZ;
int update_next_balance = 0;

for_each_domain(cpu, sd) {
if (!(sd->flags & SD_LOAD_BALANCE))
Expand Down Expand Up @@ -3079,8 +3080,10 @@ static inline void rebalance_domains(int cpu, enum cpu_idle_type idle)
if (sd->flags & SD_SERIALIZE)
spin_unlock(&balancing);
out:
if (time_after(next_balance, sd->last_balance + interval))
if (time_after(next_balance, sd->last_balance + interval)) {
next_balance = sd->last_balance + interval;
update_next_balance = 1;
}

/*
* Stop the load balance at this level. There is another
Expand All @@ -3090,7 +3093,14 @@ static inline void rebalance_domains(int cpu, enum cpu_idle_type idle)
if (!balance)
break;
}
rq->next_balance = next_balance;

/*
* next_balance will be updated only when there is a need.
* When the cpu is attached to null domain for ex, it will not be
* updated.
*/
if (likely(update_next_balance))
rq->next_balance = next_balance;
}

/*
Expand Down

0 comments on commit 31e8efd

Please sign in to comment.