On 06/03/15 15:04, Martin Lucina wrote:
The following patch implements a trivial timecounter driver for Xen. With
this patch, the test code from the "Timekeeping and scheduling" thread now
works as expected and - MySQL now attempts to start up :-)

Comments? It seemed almost too easy, so there must be something I've left
out.

Oh, it was even simpler than I thought. Nothing wrong with that, just hope you didn't use all your karma points ;)

In the long run, as Antti suggested on IRC we probably want a generic
driver using a hypercall to "get fast time" from the platform.

If it's *this* simple, not sure that's worth the effort. Let's see what happens on other platforms.

+static u_int
+rumpxen_tc_get(struct timecounter *tc)
+{
+       return (u_int)(minios_clock_monotonic() / 1000);
+}
+
+static struct timecounter rumpxen_tc = {
+       .tc_get_timecount       = rumpxen_tc_get,
+       .tc_poll_pps            = NULL,
+       .tc_counter_mask        = ~0,
+       .tc_frequency           = 1000000,
+       .tc_name                = "rumpxen",
+       .tc_quality             = 100,
+};

Can't you increase tc_frequency instead of returning a divided clock?

Reply via email to