aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c7
-rw-r--r--kernel/sched/sched.h7
2 files changed, 11 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 65a6f8b1bf14..4174338ffa36 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2137,7 +2137,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p)
2137 2137
2138 WARN_ON(task_rq(p) != rq); 2138 WARN_ON(task_rq(p) != rq);
2139 2139
2140 if (hrtick_enabled(rq) && cfs_rq->nr_running > 1) { 2140 if (cfs_rq->nr_running > 1) {
2141 u64 slice = sched_slice(cfs_rq, se); 2141 u64 slice = sched_slice(cfs_rq, se);
2142 u64 ran = se->sum_exec_runtime - se->prev_sum_exec_runtime; 2142 u64 ran = se->sum_exec_runtime - se->prev_sum_exec_runtime;
2143 s64 delta = slice - ran; 2143 s64 delta = slice - ran;
@@ -2168,7 +2168,7 @@ static void hrtick_update(struct rq *rq)
2168{ 2168{
2169 struct task_struct *curr = rq->curr; 2169 struct task_struct *curr = rq->curr;
2170 2170
2171 if (curr->sched_class != &fair_sched_class) 2171 if (!hrtick_enabled(rq) || curr->sched_class != &fair_sched_class)
2172 return; 2172 return;
2173 2173
2174 if (cfs_rq_of(&curr->se)->nr_running < sched_nr_latency) 2174 if (cfs_rq_of(&curr->se)->nr_running < sched_nr_latency)
@@ -3031,7 +3031,8 @@ static struct task_struct *pick_next_task_fair(struct rq *rq)
3031 } while (cfs_rq); 3031 } while (cfs_rq);
3032 3032
3033 p = task_of(se); 3033 p = task_of(se);
3034 hrtick_start_fair(rq, p); 3034 if (hrtick_enabled(rq))
3035 hrtick_start_fair(rq, p);
3035 3036
3036 return p; 3037 return p;
3037} 3038}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 91810f0ee3af..d88545c667e3 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -885,6 +885,13 @@ static inline int hrtick_enabled(struct rq *rq)
885 885
886void hrtick_start(struct rq *rq, u64 delay); 886void hrtick_start(struct rq *rq, u64 delay);
887 887
888#else
889
890static inline int hrtick_enabled(struct rq *rq)
891{
892 return 0;
893}
894
888#endif /* CONFIG_SCHED_HRTICK */ 895#endif /* CONFIG_SCHED_HRTICK */
889 896
890#ifdef CONFIG_SMP 897#ifdef CONFIG_SMP