Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100181
b: refs/heads/master
c: d07355f
h: refs/heads/master
i:
  100179: 9f8883d
v: v3
  • Loading branch information
Dmitry Adamushko authored and Ingo Molnar committed Jun 6, 2008
1 parent b23d853 commit 6a25f81
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 6d299f1b53b84e2665f402d9bcc494800aba6386
refs/heads/master: d07355f5def74d060333563b36ab51b89fd44cdd
6 changes: 4 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
/* Earliest time when we have to do rebalance again */
unsigned long next_balance = jiffies + 60*HZ;
int update_next_balance = 0;
int need_serialize;
cpumask_t tmp;

for_each_domain(cpu, sd) {
Expand All @@ -3685,8 +3686,9 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
if (interval > HZ*NR_CPUS/10)
interval = HZ*NR_CPUS/10;

need_serialize = sd->flags & SD_SERIALIZE;

if (sd->flags & SD_SERIALIZE) {
if (need_serialize) {
if (!spin_trylock(&balancing))
goto out;
}
Expand All @@ -3702,7 +3704,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
}
sd->last_balance = jiffies;
}
if (sd->flags & SD_SERIALIZE)
if (need_serialize)
spin_unlock(&balancing);
out:
if (time_after(next_balance, sd->last_balance + interval)) {
Expand Down

0 comments on commit 6a25f81

Please sign in to comment.