diff options
-rw-r--r-- | kernel/sched.c | 8 |
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 | ||
4139 | need_resched: | 4139 | need_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; |