diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:13 -0400 |
commit | 1e819950660e6a811b549422ffb652273257e45e (patch) | |
tree | 86bd6a49002d97de371c7e89a184a8b44c02b8d7 /kernel | |
parent | 08ec3df5109e0555da5b9deb4382fd29733c852c (diff) |
sched: optimize schedule() a bit on SMP
optimize schedule() a bit on SMP, by moving the rq-clock update
outside the rq lock.
code size is the same:
text data bss dec hex filename
25725 2666 96 28487 6f47 sched.o.before
25725 2666 96 28487 6f47 sched.o.after
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index e717047be5cf..4f13d379bea5 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3481,9 +3481,13 @@ need_resched_nonpreemptible: | |||
3481 | 3481 | ||
3482 | schedule_debug(prev); | 3482 | schedule_debug(prev); |
3483 | 3483 | ||
3484 | spin_lock_irq(&rq->lock); | 3484 | /* |
3485 | clear_tsk_need_resched(prev); | 3485 | * Do the rq-clock update outside the rq lock: |
3486 | */ | ||
3487 | local_irq_disable(); | ||
3486 | __update_rq_clock(rq); | 3488 | __update_rq_clock(rq); |
3489 | spin_lock(&rq->lock); | ||
3490 | clear_tsk_need_resched(prev); | ||
3487 | 3491 | ||
3488 | if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { | 3492 | if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { |
3489 | if (unlikely((prev->state & TASK_INTERRUPTIBLE) && | 3493 | if (unlikely((prev->state & TASK_INTERRUPTIBLE) && |