]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sched: make !hrtick faster
authorMike Galbraith <efault@gmx.de>
Mon, 12 May 2008 19:20:55 +0000 (21:20 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 6 Jun 2008 13:19:27 +0000 (15:19 +0200)
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>
kernel/sched.c

index 7178b8c2351ce5f12289bfe858f52f636fd493a9..aa960b84b881cef23034f7a7780ff2200472a219 100644 (file)
@@ -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;