Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3301
b: refs/heads/master
c: 77391d7
h: refs/heads/master
i:
  3299: b1e50c9
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Jun 25, 2005
1 parent ba42bd9 commit ac90ebf
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 476d139c218e44e045e4bc6d4cc02b010b343939
refs/heads/master: 77391d71681d05d2f4502f91ad62618522abf624
11 changes: 9 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,12 @@ static runqueue_t *find_busiest_queue(struct sched_group *group)
return busiest;
}

/*
* Max backoff if we encounter pinned tasks. Pretty arbitrary value, but
* so long as it is large enough.
*/
#define MAX_PINNED_INTERVAL 512

/*
* Check this_cpu to ensure it is balanced within domain. Attempt to move
* tasks if there is an imbalance.
Expand All @@ -2042,7 +2048,7 @@ static int load_balance(int this_cpu, runqueue_t *this_rq,
struct sched_group *group;
runqueue_t *busiest;
unsigned long imbalance;
int nr_moved, all_pinned;
int nr_moved, all_pinned = 0;
int active_balance = 0;

spin_lock(&this_rq->lock);
Expand Down Expand Up @@ -2133,7 +2139,8 @@ static int load_balance(int this_cpu, runqueue_t *this_rq,

sd->nr_balance_failed = 0;
/* tune up the balancing interval */
if (sd->balance_interval < sd->max_interval)
if ((all_pinned && sd->balance_interval < MAX_PINNED_INTERVAL) ||
(sd->balance_interval < sd->max_interval))
sd->balance_interval *= 2;

return 0;
Expand Down

0 comments on commit ac90ebf

Please sign in to comment.