aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/vmitime.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/vmitime.c')
-rw-r--r--arch/i386/kernel/vmitime.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/i386/kernel/vmitime.c b/arch/i386/kernel/vmitime.c
index 76d2adcae5a3..694aa85d22c2 100644
--- a/arch/i386/kernel/vmitime.c
+++ b/arch/i386/kernel/vmitime.c
@@ -276,16 +276,13 @@ static void vmi_account_real_cycles(unsigned long long cur_real_cycles)
276 276
277 cycles_not_accounted = cur_real_cycles - real_cycles_accounted_system; 277 cycles_not_accounted = cur_real_cycles - real_cycles_accounted_system;
278 while (cycles_not_accounted >= cycles_per_jiffy) { 278 while (cycles_not_accounted >= cycles_per_jiffy) {
279 /* systems wide jiffies and wallclock. */ 279 /* systems wide jiffies. */
280 do_timer(1); 280 do_timer(1);
281 281
282 cycles_not_accounted -= cycles_per_jiffy; 282 cycles_not_accounted -= cycles_per_jiffy;
283 real_cycles_accounted_system += cycles_per_jiffy; 283 real_cycles_accounted_system += cycles_per_jiffy;
284 } 284 }
285 285
286 if (vmi_timer_ops.wallclock_updated())
287 update_xtime_from_wallclock();
288
289 write_sequnlock(&xtime_lock); 286 write_sequnlock(&xtime_lock);
290} 287}
291 288
@@ -380,7 +377,6 @@ int vmi_stop_hz_timer(void)
380 unsigned long seq, next; 377 unsigned long seq, next;
381 unsigned long long real_cycles_expiry; 378 unsigned long long real_cycles_expiry;
382 int cpu = smp_processor_id(); 379 int cpu = smp_processor_id();
383 int idle;
384 380
385 BUG_ON(!irqs_disabled()); 381 BUG_ON(!irqs_disabled());
386 if (sysctl_hz_timer != 0) 382 if (sysctl_hz_timer != 0)
@@ -388,13 +384,13 @@ int vmi_stop_hz_timer(void)
388 384
389 cpu_set(cpu, nohz_cpu_mask); 385 cpu_set(cpu, nohz_cpu_mask);
390 smp_mb(); 386 smp_mb();
387
391 if (rcu_needs_cpu(cpu) || local_softirq_pending() || 388 if (rcu_needs_cpu(cpu) || local_softirq_pending() ||
392 (next = next_timer_interrupt(), time_before_eq(next, jiffies))) { 389 (next = next_timer_interrupt(),
390 time_before_eq(next, jiffies + HZ/CONFIG_VMI_ALARM_HZ))) {
393 cpu_clear(cpu, nohz_cpu_mask); 391 cpu_clear(cpu, nohz_cpu_mask);
394 next = jiffies; 392 return 0;
395 idle = 0; 393 }
396 } else
397 idle = 1;
398 394
399 /* Convert jiffies to the real cycle counter. */ 395 /* Convert jiffies to the real cycle counter. */
400 do { 396 do {
@@ -404,17 +400,13 @@ int vmi_stop_hz_timer(void)
404 } while (read_seqretry(&xtime_lock, seq)); 400 } while (read_seqretry(&xtime_lock, seq));
405 401
406 /* This cpu is going idle. Disable the periodic alarm. */ 402 /* This cpu is going idle. Disable the periodic alarm. */
407 if (idle) { 403 vmi_timer_ops.cancel_alarm(VMI_CYCLES_AVAILABLE);
408 vmi_timer_ops.cancel_alarm(VMI_CYCLES_AVAILABLE); 404 per_cpu(idle_start_jiffies, cpu) = jiffies;
409 per_cpu(idle_start_jiffies, cpu) = jiffies;
410 }
411
412 /* Set the real time alarm to expire at the next event. */ 405 /* Set the real time alarm to expire at the next event. */
413 vmi_timer_ops.set_alarm( 406 vmi_timer_ops.set_alarm(
414 VMI_ALARM_WIRING | VMI_ALARM_IS_ONESHOT | VMI_CYCLES_REAL, 407 VMI_ALARM_WIRING | VMI_ALARM_IS_ONESHOT | VMI_CYCLES_REAL,
415 real_cycles_expiry, 0); 408 real_cycles_expiry, 0);
416 409 return 1;
417 return idle;
418} 410}
419 411
420static void vmi_reenable_hz_timer(int cpu) 412static void vmi_reenable_hz_timer(int cpu)