diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-01-25 15:08:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 15:08:31 -0500 |
commit | 48d5e258216f1c7713633439beb98a38c7290649 (patch) | |
tree | 6f8c98785015d56337e87ed56b23d39feeeaf846 /kernel/sched_rt.c | |
parent | 614ee1f61f667b02165c1ae0c1357048dc6d94a0 (diff) |
sched: rt throttling vs no_hz
We need to teach no_hz about the rt throttling because its tick driven.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 1144bf55669d..8bfdb3f8a52d 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -175,7 +175,11 @@ static int sched_rt_ratio_exceeded(struct rt_rq *rt_rq) | |||
175 | ratio = (period * rt_ratio) >> SCHED_RT_FRAC_SHIFT; | 175 | ratio = (period * rt_ratio) >> SCHED_RT_FRAC_SHIFT; |
176 | 176 | ||
177 | if (rt_rq->rt_time > ratio) { | 177 | if (rt_rq->rt_time > ratio) { |
178 | struct rq *rq = rq_of_rt_rq(rt_rq); | ||
179 | |||
180 | rq->rt_throttled = 1; | ||
178 | rt_rq->rt_throttled = 1; | 181 | rt_rq->rt_throttled = 1; |
182 | |||
179 | sched_rt_ratio_dequeue(rt_rq); | 183 | sched_rt_ratio_dequeue(rt_rq); |
180 | return 1; | 184 | return 1; |
181 | } | 185 | } |
@@ -183,18 +187,6 @@ static int sched_rt_ratio_exceeded(struct rt_rq *rt_rq) | |||
183 | return 0; | 187 | return 0; |
184 | } | 188 | } |
185 | 189 | ||
186 | static void __update_sched_rt_period(struct rt_rq *rt_rq, u64 period) | ||
187 | { | ||
188 | unsigned long rt_ratio = sched_rt_ratio(rt_rq); | ||
189 | u64 ratio = (period * rt_ratio) >> SCHED_RT_FRAC_SHIFT; | ||
190 | |||
191 | rt_rq->rt_time -= min(rt_rq->rt_time, ratio); | ||
192 | if (rt_rq->rt_throttled) { | ||
193 | rt_rq->rt_throttled = 0; | ||
194 | sched_rt_ratio_enqueue(rt_rq); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | static void update_sched_rt_period(struct rq *rq) | 190 | static void update_sched_rt_period(struct rq *rq) |
199 | { | 191 | { |
200 | struct rt_rq *rt_rq; | 192 | struct rt_rq *rt_rq; |
@@ -204,8 +196,18 @@ static void update_sched_rt_period(struct rq *rq) | |||
204 | period = (u64)sysctl_sched_rt_period * NSEC_PER_MSEC; | 196 | period = (u64)sysctl_sched_rt_period * NSEC_PER_MSEC; |
205 | rq->rt_period_expire += period; | 197 | rq->rt_period_expire += period; |
206 | 198 | ||
207 | for_each_leaf_rt_rq(rt_rq, rq) | 199 | for_each_leaf_rt_rq(rt_rq, rq) { |
208 | __update_sched_rt_period(rt_rq, period); | 200 | unsigned long rt_ratio = sched_rt_ratio(rt_rq); |
201 | u64 ratio = (period * rt_ratio) >> SCHED_RT_FRAC_SHIFT; | ||
202 | |||
203 | rt_rq->rt_time -= min(rt_rq->rt_time, ratio); | ||
204 | if (rt_rq->rt_throttled) { | ||
205 | rt_rq->rt_throttled = 0; | ||
206 | sched_rt_ratio_enqueue(rt_rq); | ||
207 | } | ||
208 | } | ||
209 | |||
210 | rq->rt_throttled = 0; | ||
209 | } | 211 | } |
210 | } | 212 | } |
211 | 213 | ||