mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
08ec3df510
commit
1e81995066
1 changed files with 6 additions and 2 deletions
|
|
@ -3481,9 +3481,13 @@ need_resched_nonpreemptible:
|
|||
|
||||
schedule_debug(prev);
|
||||
|
||||
spin_lock_irq(&rq->lock);
|
||||
clear_tsk_need_resched(prev);
|
||||
/*
|
||||
* Do the rq-clock update outside the rq lock:
|
||||
*/
|
||||
local_irq_disable();
|
||||
__update_rq_clock(rq);
|
||||
spin_lock(&rq->lock);
|
||||
clear_tsk_need_resched(prev);
|
||||
|
||||
if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
|
||||
if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue