Commit 05aa026a authored by Tony Breeds's avatar Tony Breeds Committed by Rusty Russell

Clocksource is continuous regardless of the state of the host's TSC.

Currently lguest will spend a lot of of time waking up the host, as it
cannot go tickless (if the [host] TSC has been marked unstable). On my
laptop I was getting ~40% of wakeups from lguest.

With this patch applied, my laptop is much happier!
Signed-off-by: default avatarTony Breeds <tony@bakeyournoodle.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ebac5252
...@@ -679,6 +679,7 @@ static struct clocksource lguest_clock = { ...@@ -679,6 +679,7 @@ static struct clocksource lguest_clock = {
.mask = CLOCKSOURCE_MASK(64), .mask = CLOCKSOURCE_MASK(64),
.mult = 1 << 22, .mult = 1 << 22,
.shift = 22, .shift = 22,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
}; };
/* The "scheduler clock" is just our real clock, adjusted to start at zero */ /* The "scheduler clock" is just our real clock, adjusted to start at zero */
...@@ -760,11 +761,9 @@ static void lguest_time_init(void) ...@@ -760,11 +761,9 @@ static void lguest_time_init(void)
* the TSC, otherwise it's a dumb nanosecond-resolution clock. Either * the TSC, otherwise it's a dumb nanosecond-resolution clock. Either
* way, the "rating" is initialized so high that it's always chosen * way, the "rating" is initialized so high that it's always chosen
* over any other clocksource. */ * over any other clocksource. */
if (lguest_data.tsc_khz) { if (lguest_data.tsc_khz)
lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz, lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz,
lguest_clock.shift); lguest_clock.shift);
lguest_clock.flags = CLOCK_SOURCE_IS_CONTINUOUS;
}
clock_base = lguest_clock_read(); clock_base = lguest_clock_read();
clocksource_register(&lguest_clock); clocksource_register(&lguest_clock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment