summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2008-05-12 21:20:55 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-06 15:19:27 +0200
commitf333fdc9098b71e2687e4e9b6349fcb352960d66 (patch)
tree0abe4a006b351aa2fc675e5fcc227aeea67c0ba6 /kernel
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>
Diffstat (limited to 'kernel')
-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)
struct task_struct *prev, *next;
unsigned long *switch_count;
struct rq *rq;
- int cpu;
+ int cpu, hrtick = sched_feat(HRTICK);
need_resched:
preempt_disable();
@@ -4149,7 +4149,8 @@ need_resched_nonpreemptible:
schedule_debug(prev);
- hrtick_clear(rq);
+ if (hrtick)
+ hrtick_clear(rq);
/*
* Do the rq-clock update outside the rq lock:
@@ -4197,7 +4198,8 @@ need_resched_nonpreemptible:
} else
spin_unlock_irq(&rq->lock);
- hrtick_set(rq);
+ if (hrtick)
+ hrtick_set(rq);
if (unlikely(reacquire_kernel_lock(current) < 0))
goto need_resched_nonpreemptible;