aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2008-05-12 15:20:55 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-06 09:19:27 -0400
commitf333fdc9098b71e2687e4e9b6349fcb352960d66 (patch)
tree0abe4a006b351aa2fc675e5fcc227aeea67c0ba6
parent45c01e824991b2dd0a332e19efc4901acb31209f (diff)
sched: make !hrtick faster
it is safe to ignore timers and flags when the feature is disabled. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/sched.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 7178b8c2351c..aa960b84b881 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4134,7 +4134,7 @@ asmlinkage void __sched schedule(void)
4134 struct task_struct *prev, *next; 4134 struct task_struct *prev, *next;
4135 unsigned long *switch_count; 4135 unsigned long *switch_count;
4136 struct rq *rq; 4136 struct rq *rq;
4137 int cpu; 4137 int cpu, hrtick = sched_feat(HRTICK);
4138 4138
4139need_resched: 4139need_resched:
4140 preempt_disable(); 4140 preempt_disable();
@@ -4149,7 +4149,8 @@ need_resched_nonpreemptible:
4149 4149
4150 schedule_debug(prev); 4150 schedule_debug(prev);
4151 4151
4152 hrtick_clear(rq); 4152 if (hrtick)
4153 hrtick_clear(rq);
4153 4154
4154 /* 4155 /*
4155 * Do the rq-clock update outside the rq lock: 4156 * Do the rq-clock update outside the rq lock:
@@ -4197,7 +4198,8 @@ need_resched_nonpreemptible:
4197 } else 4198 } else
4198 spin_unlock_irq(&rq->lock); 4199 spin_unlock_irq(&rq->lock);
4199 4200
4200 hrtick_set(rq); 4201 if (hrtick)
4202 hrtick_set(rq);
4201 4203
4202 if (unlikely(reacquire_kernel_lock(current) < 0)) 4204 if (unlikely(reacquire_kernel_lock(current) < 0))
4203 goto need_resched_nonpreemptible; 4205 goto need_resched_nonpreemptible;