Skip to content

Commit

Permalink
sched: make !hrtick faster
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Jun 6, 2008
1 parent 45c01e8 commit f333fdc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -4149,7 +4149,8 @@ asmlinkage void __sched schedule(void)

schedule_debug(prev);

hrtick_clear(rq);
if (hrtick)
hrtick_clear(rq);

/*
* Do the rq-clock update outside the rq lock:
Expand Down Expand Up @@ -4197,7 +4198,8 @@ asmlinkage void __sched schedule(void)
} 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;
Expand Down

0 comments on commit f333fdc

Please sign in to comment.