Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118480
b: refs/heads/master
c: 0247909
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Nov 5, 2008
1 parent 8cebaed commit f3aed57
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 4793241be408b3926ee00c704d7da3b3faf3a05f
refs/heads/master: 02479099c286894644f8e96c6bbb535ab64662fd
16 changes: 14 additions & 2 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,18 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
return 0;
}

static void set_last_buddy(struct sched_entity *se)
{
for_each_sched_entity(se)
cfs_rq_of(se)->last = se;
}

static void set_next_buddy(struct sched_entity *se)
{
for_each_sched_entity(se)
cfs_rq_of(se)->next = se;
}

/*
* Preempt the current task with a newly woken task if needed:
*/
Expand Down Expand Up @@ -1352,8 +1364,8 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
* obvious reasons its a bad idea to schedule back to the idle thread.
*/
if (sched_feat(LAST_BUDDY) && likely(se->on_rq && curr != rq->idle))
cfs_rq_of(se)->last = se;
cfs_rq_of(pse)->next = pse;
set_last_buddy(se);
set_next_buddy(pse);

/*
* We can come here with TIF_NEED_RESCHED already set from new task
Expand Down

0 comments on commit f3aed57

Please sign in to comment.