diff options
author | Bharat Bhushan <r65777@freescale.com> | 2012-04-18 02:01:19 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-05-06 10:19:07 -0400 |
commit | 6e35994d1f6831af1e5577e28c363c9137d7d597 (patch) | |
tree | 4c230223e9f76865a2bf01e4f4893b30fe2482b7 /arch/powerpc/kernel/time.c | |
parent | cc902ad4f2b7cd3dd2cc268c63f6fb99fb1abf0f (diff) |
KVM: PPC: Use clockevent multiplier and shifter for decrementer
Time for which the hrtimer is started for decrementer emulation is calculated
using tb_ticks_per_usec. While hrtimer uses the clockevent for DEC
reprogramming (if needed) and which calculate timebase ticks using the
multiplier and shifter mechanism implemented within clockevent layer.
It was observed that this conversion (timebase->time->timebase) are not
correct because the mechanism are not consistent.
In our setup it adds 2% jitter.
With this patch clockevent multiplier and shifter mechanism are used when
starting hrtimer for decrementer emulation. Now the jitter is < 0.5%.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r-- | arch/powerpc/kernel/time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 2c42cd72d0f5..99a995c2a3f2 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -100,7 +100,7 @@ static int decrementer_set_next_event(unsigned long evt, | |||
100 | static void decrementer_set_mode(enum clock_event_mode mode, | 100 | static void decrementer_set_mode(enum clock_event_mode mode, |
101 | struct clock_event_device *dev); | 101 | struct clock_event_device *dev); |
102 | 102 | ||
103 | static struct clock_event_device decrementer_clockevent = { | 103 | struct clock_event_device decrementer_clockevent = { |
104 | .name = "decrementer", | 104 | .name = "decrementer", |
105 | .rating = 200, | 105 | .rating = 200, |
106 | .irq = 0, | 106 | .irq = 0, |
@@ -108,6 +108,7 @@ static struct clock_event_device decrementer_clockevent = { | |||
108 | .set_mode = decrementer_set_mode, | 108 | .set_mode = decrementer_set_mode, |
109 | .features = CLOCK_EVT_FEAT_ONESHOT, | 109 | .features = CLOCK_EVT_FEAT_ONESHOT, |
110 | }; | 110 | }; |
111 | EXPORT_SYMBOL(decrementer_clockevent); | ||
111 | 112 | ||
112 | DEFINE_PER_CPU(u64, decrementers_next_tb); | 113 | DEFINE_PER_CPU(u64, decrementers_next_tb); |
113 | static DEFINE_PER_CPU(struct clock_event_device, decrementers); | 114 | static DEFINE_PER_CPU(struct clock_event_device, decrementers); |