Skip to content

Commit

Permalink
sched: sync wakeups preempt too
Browse files Browse the repository at this point in the history
make sure sync wakeups preempt too - the scheduler will not
overschedule as we've got various throttles against that.
As a result, sync wakeups can be used more widely in the kernel
(to signal wakeup affinity between tasks), and no arbitrary
latencies will be introduced either.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Oct 15, 2007
1 parent 71e20f1 commit 9c63d9c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,16 +1596,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
schedstat_inc(p, se.nr_wakeups_remote);
update_rq_clock(rq);
activate_task(rq, p, 1);
/*
* Sync wakeups (i.e. those types of wakeups where the waker
* has indicated that it will leave the CPU in short order)
* don't trigger a preemption, if the woken up task will run on
* this cpu. (in this case the 'I will reschedule' promise of
* the waker guarantees that the freshly woken up task is going
* to be considered on this CPU.)
*/
if (!sync || rq->curr == rq->idle)
check_preempt_curr(rq, p);
check_preempt_curr(rq, p);
success = 1;

out_running:
Expand Down

0 comments on commit 9c63d9c

Please sign in to comment.