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>
This commit is contained in:

committed by
Alexander Graf

父節點
cc902ad4f2
當前提交
6e35994d1f
@@ -100,7 +100,7 @@ static int decrementer_set_next_event(unsigned long evt,
|
||||
static void decrementer_set_mode(enum clock_event_mode mode,
|
||||
struct clock_event_device *dev);
|
||||
|
||||
static struct clock_event_device decrementer_clockevent = {
|
||||
struct clock_event_device decrementer_clockevent = {
|
||||
.name = "decrementer",
|
||||
.rating = 200,
|
||||
.irq = 0,
|
||||
@@ -108,6 +108,7 @@ static struct clock_event_device decrementer_clockevent = {
|
||||
.set_mode = decrementer_set_mode,
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT,
|
||||
};
|
||||
EXPORT_SYMBOL(decrementer_clockevent);
|
||||
|
||||
DEFINE_PER_CPU(u64, decrementers_next_tb);
|
||||
static DEFINE_PER_CPU(struct clock_event_device, decrementers);
|
||||
|
Reference in New Issue
Block a user