Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163020
b: refs/heads/master
c: 5158f4e
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 16, 2009
1 parent 9e235b9 commit 6a9ffdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 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: 3b6408942206f940dd538e980e9904e48f4b64f8
refs/heads/master: 5158f4e4428c6b8d52796b3b460e95796123a114
27 changes: 8 additions & 19 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,26 +1248,11 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
*/
static struct sched_group *
find_idlest_group(struct sched_domain *sd, struct task_struct *p,
int this_cpu, int flag)
int this_cpu, int load_idx)
{
struct sched_group *idlest = NULL, *this = NULL, *group = sd->groups;
unsigned long min_load = ULONG_MAX, this_load = 0;
int imbalance = 100 + (sd->imbalance_pct-100)/2;
int load_idx = 0;

switch (flag) {
case SD_BALANCE_FORK:
case SD_BALANCE_EXEC:
load_idx = sd->forkexec_idx;
break;

case SD_BALANCE_WAKE:
load_idx = sd->wake_idx;
break;

default:
break;
}

do {
unsigned long load, avg_load;
Expand Down Expand Up @@ -1346,14 +1331,14 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
*
* preempt must be disabled.
*/
static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags)
static int select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags)
{
struct sched_domain *tmp, *shares = NULL, *sd = NULL;
int cpu = smp_processor_id();
int prev_cpu = task_cpu(p);
int new_cpu = cpu;
int want_affine = 0;
int sync = flags & WF_SYNC;
int sync = wake_flags & WF_SYNC;

if (sd_flag & SD_BALANCE_WAKE) {
if (sched_feat(AFFINE_WAKEUPS))
Expand Down Expand Up @@ -1413,6 +1398,7 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags)
update_shares(sd);

while (sd) {
int load_idx = sd->forkexec_idx;
struct sched_group *group;
int weight;

Expand All @@ -1421,7 +1407,10 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int flags)
continue;
}

group = find_idlest_group(sd, p, cpu, sd_flag);
if (sd_flag & SD_BALANCE_WAKE)
load_idx = sd->wake_idx;

group = find_idlest_group(sd, p, cpu, load_idx);
if (!group) {
sd = sd->child;
continue;
Expand Down

0 comments on commit 6a9ffdb

Please sign in to comment.