Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13463
b: refs/heads/master
c: 6dd4a85
h: refs/heads/master
i:
  13461: cfd776b
  13459: 8881525
  13455: 3026940
v: v3
  • Loading branch information
Con Kolivas authored and Linus Torvalds committed Nov 9, 2005
1 parent edbee93 commit c2b40b7
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 3b0bd9bc6f3b8a47853d1b1de4520de3878e8941
refs/heads/master: 6dd4a85bb3ee0715415892c8b0f2a9bd08d31ca4
14 changes: 8 additions & 6 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,15 +972,16 @@ void kick_process(task_t *p)
static inline unsigned long __source_load(int cpu, int type, enum idle_type idle)
{
runqueue_t *rq = cpu_rq(cpu);
unsigned long running = rq->nr_running;
unsigned long source_load, cpu_load = rq->cpu_load[type-1],
load_now = rq->nr_running * SCHED_LOAD_SCALE;
load_now = running * SCHED_LOAD_SCALE;

if (type == 0)
source_load = load_now;
else
source_load = min(cpu_load, load_now);

if (idle == NOT_IDLE || rq->nr_running > 1)
if (running > 1 || (idle == NOT_IDLE && running))
/*
* If we are busy rebalancing the load is biased by
* priority to create 'nice' support across cpus. When
Expand All @@ -989,7 +990,7 @@ static inline unsigned long __source_load(int cpu, int type, enum idle_type idle
* prevent idle rebalance from trying to pull tasks from a
* queue with only one running task.
*/
source_load *= rq->prio_bias;
source_load = source_load * rq->prio_bias / running;

return source_load;
}
Expand All @@ -1005,16 +1006,17 @@ static inline unsigned long source_load(int cpu, int type)
static inline unsigned long __target_load(int cpu, int type, enum idle_type idle)
{
runqueue_t *rq = cpu_rq(cpu);
unsigned long running = rq->nr_running;
unsigned long target_load, cpu_load = rq->cpu_load[type-1],
load_now = rq->nr_running * SCHED_LOAD_SCALE;
load_now = running * SCHED_LOAD_SCALE;

if (type == 0)
target_load = load_now;
else
target_load = max(cpu_load, load_now);

if (idle == NOT_IDLE || rq->nr_running > 1)
target_load *= rq->prio_bias;
if (running > 1 || (idle == NOT_IDLE && running))
target_load = target_load * rq->prio_bias / running;

return target_load;
}
Expand Down

0 comments on commit c2b40b7

Please sign in to comment.