Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3284
b: refs/heads/master
c: 16cfb1c
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Jun 25, 2005
1 parent ba6c1ad commit d3b9991
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 8102679447da7fcbcb5226ee0207c3a034bc6d5f
refs/heads/master: 16cfb1c04c3cbe3759f339d3333e7e1e7d59712a
16 changes: 10 additions & 6 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,7 @@ static int load_balance(int this_cpu, runqueue_t *this_rq,

schedstat_inc(sd, lb_balanced[idle]);

sd->nr_balance_failed = 0;
/* tune up the balancing interval */
if (sd->balance_interval < sd->max_interval)
sd->balance_interval *= 2;
Expand All @@ -2046,16 +2047,14 @@ static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
schedstat_inc(sd, lb_cnt[NEWLY_IDLE]);
group = find_busiest_group(sd, this_cpu, &imbalance, NEWLY_IDLE);
if (!group) {
schedstat_inc(sd, lb_balanced[NEWLY_IDLE]);
schedstat_inc(sd, lb_nobusyg[NEWLY_IDLE]);
goto out;
goto out_balanced;
}

busiest = find_busiest_queue(group);
if (!busiest || busiest == this_rq) {
schedstat_inc(sd, lb_balanced[NEWLY_IDLE]);
schedstat_inc(sd, lb_nobusyq[NEWLY_IDLE]);
goto out;
goto out_balanced;
}

/* Attempt to move tasks */
Expand All @@ -2066,11 +2065,16 @@ static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
imbalance, sd, NEWLY_IDLE, NULL);
if (!nr_moved)
schedstat_inc(sd, lb_failed[NEWLY_IDLE]);
else
sd->nr_balance_failed = 0;

spin_unlock(&busiest->lock);

out:
return nr_moved;

out_balanced:
schedstat_inc(sd, lb_balanced[NEWLY_IDLE]);
sd->nr_balance_failed = 0;
return 0;
}

/*
Expand Down

0 comments on commit d3b9991

Please sign in to comment.