Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43986
b: refs/heads/master
c: 1bd77f2
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Dec 10, 2006
1 parent e01c215 commit f370e96
Show file tree
Hide file tree
Showing 2 changed files with 17 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: c9819f4593e8d052b41a89f47140f5c5e7e30582
refs/heads/master: 1bd77f2da58e9cdd1f159217887343dadd9af417
18 changes: 16 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2774,14 +2774,28 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
static void idle_balance(int this_cpu, struct rq *this_rq)
{
struct sched_domain *sd;
int pulled_task = 0;
unsigned long next_balance = jiffies + 60 * HZ;

for_each_domain(this_cpu, sd) {
if (sd->flags & SD_BALANCE_NEWIDLE) {
/* If we've pulled tasks over stop searching: */
if (load_balance_newidle(this_cpu, this_rq, sd))
pulled_task = load_balance_newidle(this_cpu,
this_rq, sd);
if (time_after(next_balance,
sd->last_balance + sd->balance_interval))
next_balance = sd->last_balance
+ sd->balance_interval;
if (pulled_task)
break;
}
}
if (!pulled_task)
/*
* We are going idle. next_balance may be set based on
* a busy processor. So reset next_balance.
*/
this_rq->next_balance = next_balance;
}

/*
Expand Down Expand Up @@ -2904,7 +2918,7 @@ static void run_rebalance_domains(struct softirq_action *h)
*/
idle = NOT_IDLE;
}
sd->last_balance += interval;
sd->last_balance = jiffies;
}
if (time_after(next_balance, sd->last_balance + interval))
next_balance = sd->last_balance + interval;
Expand Down

0 comments on commit f370e96

Please sign in to comment.