aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index c642ef75069f..f78777abe769 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1238,51 +1238,50 @@ void hrtimer_run_pending(void)
1238/* 1238/*
1239 * Called from hardirq context every jiffy 1239 * Called from hardirq context every jiffy
1240 */ 1240 */
1241static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base, 1241void hrtimer_run_queues(void)
1242 int index)
1243{ 1242{
1244 struct rb_node *node; 1243 struct rb_node *node;
1245 struct hrtimer_clock_base *base = &cpu_base->clock_base[index]; 1244 struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
1245 struct hrtimer_clock_base *base;
1246 int index, gettime = 1;
1246 1247
1247 if (!base->first) 1248 if (hrtimer_hres_active())
1248 return; 1249 return;
1249 1250
1250 if (base->get_softirq_time) 1251 for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {
1251 base->softirq_time = base->get_softirq_time(); 1252 base = &cpu_base->clock_base[index];
1252
1253 spin_lock(&cpu_base->lock);
1254 1253
1255 while ((node = base->first)) { 1254 if (!base->first)
1256 struct hrtimer *timer;
1257
1258 timer = rb_entry(node, struct hrtimer, node);
1259 if (base->softirq_time.tv64 <= timer->expires.tv64)
1260 break;
1261
1262 if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) {
1263 __remove_hrtimer(timer, base, HRTIMER_STATE_PENDING, 0);
1264 list_add_tail(&timer->cb_entry,
1265 &base->cpu_base->cb_pending);
1266 continue; 1255 continue;
1256
1257 if (base->get_softirq_time)
1258 base->softirq_time = base->get_softirq_time();
1259 else if (gettime) {
1260 hrtimer_get_softirq_time(cpu_base);
1261 gettime = 0;
1267 } 1262 }
1268 1263
1269 __run_hrtimer(timer); 1264 spin_lock(&cpu_base->lock);
1270 }
1271 spin_unlock(&cpu_base->lock);
1272}
1273 1265
1274void hrtimer_run_queues(void) 1266 while ((node = base->first)) {
1275{ 1267 struct hrtimer *timer;
1276 struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
1277 int i;
1278 1268
1279 if (hrtimer_hres_active()) 1269 timer = rb_entry(node, struct hrtimer, node);
1280 return; 1270 if (base->softirq_time.tv64 <= timer->expires.tv64)
1271 break;
1281 1272
1282 hrtimer_get_softirq_time(cpu_base); 1273 if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) {
1274 __remove_hrtimer(timer, base,
1275 HRTIMER_STATE_PENDING, 0);
1276 list_add_tail(&timer->cb_entry,
1277 &base->cpu_base->cb_pending);
1278 continue;
1279 }
1283 1280
1284 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) 1281 __run_hrtimer(timer);
1285 run_hrtimer_queue(cpu_base, i); 1282 }
1283 spin_unlock(&cpu_base->lock);
1284 }
1286} 1285}
1287 1286
1288/* 1287/*