From: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
To: Luca Tettamanti <kronos.it-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-TtF/mJH4Jtrk1uMJSBkQmQ@public.gmane.org,
qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 0/4] Rework alarm timer infrastrucure - take2
Date: Sat, 18 Aug 2007 18:58:25 -0500 [thread overview]
Message-ID: <1187481505.15472.3.camel@squirrel> (raw)
In-Reply-To: <20070818220252.GA19526-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
I think this is a really nice and important patch set. Just a couple
things:
On Sun, 2007-08-19 at 00:02 +0200, Luca Tettamanti wrote:
> > In this case the dyn-tick minimum res will be 1msec. I believe it should
> > work ok since this is the case without any dyn-tick.
>
> Actually minimum resolution depends on host HZ setting, but - yes -
> essentially you have the same behaviour of the "unix" timer, plus the
> overhead of reprogramming the timer.
Is this significant? At a high guest HZ, this is could be quite a lot
of additional syscalls right?
> Add support for dynamic ticks.
>
> If the the dynticks alarm timer is used qemu does not attempt to generate
> SIGALRM at a constant rate. Rather, the system timer is set to generate SIGALRM
> only when it is needed. Dynticks timer reduces the number of SIGALRMs sent to
> idle dynamic-ticked guests.
> Original patch from Dan Kenigsberg <dank-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>
> Signed-off-by: Luca Tettamanti <kronos.it-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> ---
> vl.c | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 170 insertions(+), 8 deletions(-)
>
> Index: qemu/vl.c
> ===================================================================
> --- qemu.orig/vl.c 2007-08-18 23:23:47.000000000 +0200
> +++ qemu/vl.c 2007-08-18 23:23:53.000000000 +0200
> @@ -784,12 +784,31 @@
>
> struct qemu_alarm_timer {
> char const *name;
> + unsigned int flags;
>
> int (*start)(struct qemu_alarm_timer *t);
> void (*stop)(struct qemu_alarm_timer *t);
> + void (*rearm)(struct qemu_alarm_timer *t);
> void *priv;
> };
>
> +#define ALARM_FLAG_DYNTICKS 0x1
> +
> +static inline int alarm_has_dynticks(struct qemu_alarm_timer *t)
> +{
> + return t->flags & ALARM_FLAG_DYNTICKS;
> +}
> +
> +static void qemu_rearm_alarm_timer(struct qemu_alarm_timer *t) {
The '{' should be on the next line.
The rest looks fine.
Regards,
Anthony Liguori
> + if (!alarm_has_dynticks(t))
> + return;
> +
> + t->rearm(t);
> +}
> +
> +/* TODO: MIN_TIMER_REARM_US should be optimized */
> +#define MIN_TIMER_REARM_US 250
> +
> static struct qemu_alarm_timer *alarm_timer;
>
> #ifdef _WIN32
> @@ -802,12 +821,17 @@
>
> static int win32_start_timer(struct qemu_alarm_timer *t);
> static void win32_stop_timer(struct qemu_alarm_timer *t);
> +static void win32_rearm_timer(struct qemu_alarm_timer *t);
>
> #else
>
> static int unix_start_timer(struct qemu_alarm_timer *t);
> static void unix_stop_timer(struct qemu_alarm_timer *t);
>
> +static int dynticks_start_timer(struct qemu_alarm_timer *t);
> +static void dynticks_stop_timer(struct qemu_alarm_timer *t);
> +static void dynticks_rearm_timer(struct qemu_alarm_timer *t);
> +
> #ifdef __linux__
>
> static int hpet_start_timer(struct qemu_alarm_timer *t);
> @@ -816,21 +840,23 @@
> static int rtc_start_timer(struct qemu_alarm_timer *t);
> static void rtc_stop_timer(struct qemu_alarm_timer *t);
>
> -#endif
> +#endif /* __linux__ */
>
> #endif /* _WIN32 */
>
> static struct qemu_alarm_timer alarm_timers[] = {
> +#ifndef _WIN32
> + {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer, dynticks_stop_timer, dynticks_rearm_timer, NULL},
> #ifdef __linux__
> /* HPET - if available - is preferred */
> - {"hpet", hpet_start_timer, hpet_stop_timer, NULL},
> + {"hpet", 0, hpet_start_timer, hpet_stop_timer, NULL, NULL},
> /* ...otherwise try RTC */
> - {"rtc", rtc_start_timer, rtc_stop_timer, NULL},
> + {"rtc", 0, rtc_start_timer, rtc_stop_timer, NULL, NULL},
> #endif
> -#ifndef _WIN32
> - {"unix", unix_start_timer, unix_stop_timer, NULL},
> + {"unix", 0, unix_start_timer, unix_stop_timer, NULL, NULL},
> #else
> - {"win32", win32_start_timer, win32_stop_timer, &alarm_win32_data},
> + {"dynticks", ALARM_FLAG_DYNTICKS, win32_start_timer, win32_stop_timer, win32_rearm_timer, &alarm_win32_data},
> + {"win32", 0, win32_start_timer, win32_stop_timer, NULL, &alarm_win32_data},
> #endif
> {NULL, }
> };
> @@ -949,6 +975,8 @@
> }
> pt = &t->next;
> }
> +
> + qemu_rearm_alarm_timer(alarm_timer);
> }
>
> /* modify the current timer so that it will be fired when current_time
> @@ -1008,6 +1036,7 @@
> /* run the callback (the timer list can be modified) */
> ts->cb(ts->opaque);
> }
> + qemu_rearm_alarm_timer(alarm_timer);
> }
>
> int64_t qemu_get_clock(QEMUClock *clock)
> @@ -1115,7 +1144,8 @@
> last_clock = ti;
> }
> #endif
> - if (qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL],
> + if (alarm_has_dynticks(alarm_timer) ||
> + qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL],
> qemu_get_clock(vm_clock)) ||
> qemu_timer_expired(active_timers[QEMU_TIMER_REALTIME],
> qemu_get_clock(rt_clock))) {
> @@ -1136,6 +1166,27 @@
> }
> }
>
> +static uint64_t qemu_next_deadline(void) {
> + uint64_t nearest_delta_us = ULLONG_MAX;
> + uint64_t vmdelta_us;
> +
> + if (active_timers[QEMU_TIMER_REALTIME])
> + nearest_delta_us = (active_timers[QEMU_TIMER_REALTIME]->expire_time - qemu_get_clock(rt_clock))*1000;
> +
> + if (active_timers[QEMU_TIMER_VIRTUAL]) {
> + /* round up */
> + vmdelta_us = (active_timers[QEMU_TIMER_VIRTUAL]->expire_time - qemu_get_clock(vm_clock)+999)/1000;
> + if (vmdelta_us < nearest_delta_us)
> + nearest_delta_us = vmdelta_us;
> + }
> +
> + /* Avoid arming the timer to negative, zero, or too low values */
> + if (nearest_delta_us <= MIN_TIMER_REARM_US)
> + nearest_delta_us = MIN_TIMER_REARM_US;
> +
> + return nearest_delta_us;
> +}
> +
> #ifndef _WIN32
>
> #if defined(__linux__)
> @@ -1243,6 +1294,80 @@
>
> #endif /* !defined(__linux__) */
>
> +static int dynticks_start_timer(struct qemu_alarm_timer *t)
> +{
> + struct sigevent ev;
> + timer_t host_timer;
> + struct sigaction act;
> +
> + sigfillset(&act.sa_mask);
> + act.sa_flags = 0;
> +#if defined(TARGET_I386) && defined(USE_CODE_COPY)
> + act.sa_flags |= SA_ONSTACK;
> +#endif
> + act.sa_handler = host_alarm_handler;
> +
> + sigaction(SIGALRM, &act, NULL);
> +
> + ev.sigev_value.sival_int = 0;
> + ev.sigev_notify = SIGEV_SIGNAL;
> + ev.sigev_signo = SIGALRM;
> +
> + if (timer_create(CLOCK_REALTIME, &ev, &host_timer)) {
> + perror("timer_create");
> +
> + /* disable dynticks */
> + fprintf(stderr, "Dynamic Ticks disabled\n");
> +
> + return -1;
> + }
> +
> + t->priv = (void *)host_timer;
> +
> + return 0;
> +}
> +
> +static void dynticks_stop_timer(struct qemu_alarm_timer *t)
> +{
> + timer_t host_timer = (timer_t)t->priv;
> +
> + timer_delete(host_timer);
> +}
> +
> +static void dynticks_rearm_timer(struct qemu_alarm_timer *t)
> +{
> + timer_t host_timer = (timer_t)t->priv;
> + struct itimerspec timeout;
> + int64_t nearest_delta_us = INT64_MAX;
> + int64_t current_us;
> +
> + if (!active_timers[QEMU_TIMER_REALTIME] &&
> + !active_timers[QEMU_TIMER_VIRTUAL])
> + return;
> +
> + nearest_delta_us = qemu_next_deadline();
> +
> + /* check whether a timer is already running */
> + if (timer_gettime(host_timer, &timeout)) {
> + perror("gettime");
> + fprintf(stderr, "Internal timer error: aborting\n");
> + exit(1);
> + }
> + current_us = timeout.it_value.tv_sec * 1000000 + timeout.it_value.tv_nsec/1000;
> + if (current_us && current_us <= nearest_delta_us)
> + return;
> +
> + timeout.it_interval.tv_sec = 0;
> + timeout.it_interval.tv_nsec = 0; /* 0 for one-shot timer */
> + timeout.it_value.tv_sec = nearest_delta_us / 1000000;
> + timeout.it_value.tv_nsec = (nearest_delta_us % 1000000) * 1000;
> + if (timer_settime(host_timer, 0 /* RELATIVE */, &timeout, NULL)) {
> + perror("settime");
> + fprintf(stderr, "Internal timer error: aborting\n");
> + exit(1);
> + }
> +}
> +
> static int unix_start_timer(struct qemu_alarm_timer *t)
> {
> struct sigaction act;
> @@ -1288,6 +1413,7 @@
> {
> TIMECAPS tc;
> struct qemu_alarm_win32 *data = t->priv;
> + UINT flags;
>
> data->host_alarm = CreateEvent(NULL, FALSE, FALSE, NULL);
> if (!data->host_alarm) {
> @@ -1304,11 +1430,17 @@
>
> timeBeginPeriod(data->period);
>
> + flags = TIME_CALLBACK_FUNCTION;
> + if (alarm_has_dynticks(t))
> + flags |= TIME_ONESHOT;
> + else
> + flags |= TIME_PERIODIC;
> +
> data->timerId = timeSetEvent(1, // interval (ms)
> data->period, // resolution
> host_alarm_handler, // function
> (DWORD)t, // parameter
> - TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
> + flags);
>
> if (!data->timerId) {
> perror("Failed to initialize win32 alarm timer");
> @@ -1333,6 +1465,35 @@
> CloseHandle(data->host_alarm);
> }
>
> +static void win32_rearm_timer(struct qemu_alarm_timer *t)
> +{
> + struct qemu_alarm_win32 *data = t->priv;
> + uint64_t nearest_delta_us;
> +
> + if (!active_timers[QEMU_TIMER_REALTIME] &&
> + !active_timers[QEMU_TIMER_VIRTUAL])
> + return;
> +
> + nearest_delta_us = qemu_next_deadline();
> + nearest_delta_us /= 1000;
> +
> + timeKillEvent(data->timerId);
> +
> + data->timerId = timeSetEvent(1,
> + data->period,
> + host_alarm_handler,
> + (DWORD)t,
> + TIME_ONESHOT | TIME_PERIODIC);
> +
> + if (!data->timerId) {
> + perror("Failed to re-arm win32 alarm timer");
> +
> + timeEndPeriod(data->period);
> + CloseHandle(data->host_alarm);
> + exit(1);
> + }
> +}
> +
> #endif /* _WIN32 */
>
> static void init_timer_alarm(void)
> @@ -6491,6 +6652,7 @@
> cpu_enable_ticks();
> vm_running = 1;
> vm_state_notify(1);
> + qemu_rearm_alarm_timer(alarm_timer);
> }
> }
>
>
> Luca
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <anthony@codemonkey.ws>
To: Luca Tettamanti <kronos.it@gmail.com>
Cc: kvm-devel@lists.sf.net, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take2
Date: Sat, 18 Aug 2007 18:58:25 -0500 [thread overview]
Message-ID: <1187481505.15472.3.camel@squirrel> (raw)
In-Reply-To: <20070818220252.GA19526@dreamland.darkstar.lan>
I think this is a really nice and important patch set. Just a couple
things:
On Sun, 2007-08-19 at 00:02 +0200, Luca Tettamanti wrote:
> > In this case the dyn-tick minimum res will be 1msec. I believe it should
> > work ok since this is the case without any dyn-tick.
>
> Actually minimum resolution depends on host HZ setting, but - yes -
> essentially you have the same behaviour of the "unix" timer, plus the
> overhead of reprogramming the timer.
Is this significant? At a high guest HZ, this is could be quite a lot
of additional syscalls right?
> Add support for dynamic ticks.
>
> If the the dynticks alarm timer is used qemu does not attempt to generate
> SIGALRM at a constant rate. Rather, the system timer is set to generate SIGALRM
> only when it is needed. Dynticks timer reduces the number of SIGALRMs sent to
> idle dynamic-ticked guests.
> Original patch from Dan Kenigsberg <dank@qumranet.com>
>
> Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
>
> ---
> vl.c | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 170 insertions(+), 8 deletions(-)
>
> Index: qemu/vl.c
> ===================================================================
> --- qemu.orig/vl.c 2007-08-18 23:23:47.000000000 +0200
> +++ qemu/vl.c 2007-08-18 23:23:53.000000000 +0200
> @@ -784,12 +784,31 @@
>
> struct qemu_alarm_timer {
> char const *name;
> + unsigned int flags;
>
> int (*start)(struct qemu_alarm_timer *t);
> void (*stop)(struct qemu_alarm_timer *t);
> + void (*rearm)(struct qemu_alarm_timer *t);
> void *priv;
> };
>
> +#define ALARM_FLAG_DYNTICKS 0x1
> +
> +static inline int alarm_has_dynticks(struct qemu_alarm_timer *t)
> +{
> + return t->flags & ALARM_FLAG_DYNTICKS;
> +}
> +
> +static void qemu_rearm_alarm_timer(struct qemu_alarm_timer *t) {
The '{' should be on the next line.
The rest looks fine.
Regards,
Anthony Liguori
> + if (!alarm_has_dynticks(t))
> + return;
> +
> + t->rearm(t);
> +}
> +
> +/* TODO: MIN_TIMER_REARM_US should be optimized */
> +#define MIN_TIMER_REARM_US 250
> +
> static struct qemu_alarm_timer *alarm_timer;
>
> #ifdef _WIN32
> @@ -802,12 +821,17 @@
>
> static int win32_start_timer(struct qemu_alarm_timer *t);
> static void win32_stop_timer(struct qemu_alarm_timer *t);
> +static void win32_rearm_timer(struct qemu_alarm_timer *t);
>
> #else
>
> static int unix_start_timer(struct qemu_alarm_timer *t);
> static void unix_stop_timer(struct qemu_alarm_timer *t);
>
> +static int dynticks_start_timer(struct qemu_alarm_timer *t);
> +static void dynticks_stop_timer(struct qemu_alarm_timer *t);
> +static void dynticks_rearm_timer(struct qemu_alarm_timer *t);
> +
> #ifdef __linux__
>
> static int hpet_start_timer(struct qemu_alarm_timer *t);
> @@ -816,21 +840,23 @@
> static int rtc_start_timer(struct qemu_alarm_timer *t);
> static void rtc_stop_timer(struct qemu_alarm_timer *t);
>
> -#endif
> +#endif /* __linux__ */
>
> #endif /* _WIN32 */
>
> static struct qemu_alarm_timer alarm_timers[] = {
> +#ifndef _WIN32
> + {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer, dynticks_stop_timer, dynticks_rearm_timer, NULL},
> #ifdef __linux__
> /* HPET - if available - is preferred */
> - {"hpet", hpet_start_timer, hpet_stop_timer, NULL},
> + {"hpet", 0, hpet_start_timer, hpet_stop_timer, NULL, NULL},
> /* ...otherwise try RTC */
> - {"rtc", rtc_start_timer, rtc_stop_timer, NULL},
> + {"rtc", 0, rtc_start_timer, rtc_stop_timer, NULL, NULL},
> #endif
> -#ifndef _WIN32
> - {"unix", unix_start_timer, unix_stop_timer, NULL},
> + {"unix", 0, unix_start_timer, unix_stop_timer, NULL, NULL},
> #else
> - {"win32", win32_start_timer, win32_stop_timer, &alarm_win32_data},
> + {"dynticks", ALARM_FLAG_DYNTICKS, win32_start_timer, win32_stop_timer, win32_rearm_timer, &alarm_win32_data},
> + {"win32", 0, win32_start_timer, win32_stop_timer, NULL, &alarm_win32_data},
> #endif
> {NULL, }
> };
> @@ -949,6 +975,8 @@
> }
> pt = &t->next;
> }
> +
> + qemu_rearm_alarm_timer(alarm_timer);
> }
>
> /* modify the current timer so that it will be fired when current_time
> @@ -1008,6 +1036,7 @@
> /* run the callback (the timer list can be modified) */
> ts->cb(ts->opaque);
> }
> + qemu_rearm_alarm_timer(alarm_timer);
> }
>
> int64_t qemu_get_clock(QEMUClock *clock)
> @@ -1115,7 +1144,8 @@
> last_clock = ti;
> }
> #endif
> - if (qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL],
> + if (alarm_has_dynticks(alarm_timer) ||
> + qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL],
> qemu_get_clock(vm_clock)) ||
> qemu_timer_expired(active_timers[QEMU_TIMER_REALTIME],
> qemu_get_clock(rt_clock))) {
> @@ -1136,6 +1166,27 @@
> }
> }
>
> +static uint64_t qemu_next_deadline(void) {
> + uint64_t nearest_delta_us = ULLONG_MAX;
> + uint64_t vmdelta_us;
> +
> + if (active_timers[QEMU_TIMER_REALTIME])
> + nearest_delta_us = (active_timers[QEMU_TIMER_REALTIME]->expire_time - qemu_get_clock(rt_clock))*1000;
> +
> + if (active_timers[QEMU_TIMER_VIRTUAL]) {
> + /* round up */
> + vmdelta_us = (active_timers[QEMU_TIMER_VIRTUAL]->expire_time - qemu_get_clock(vm_clock)+999)/1000;
> + if (vmdelta_us < nearest_delta_us)
> + nearest_delta_us = vmdelta_us;
> + }
> +
> + /* Avoid arming the timer to negative, zero, or too low values */
> + if (nearest_delta_us <= MIN_TIMER_REARM_US)
> + nearest_delta_us = MIN_TIMER_REARM_US;
> +
> + return nearest_delta_us;
> +}
> +
> #ifndef _WIN32
>
> #if defined(__linux__)
> @@ -1243,6 +1294,80 @@
>
> #endif /* !defined(__linux__) */
>
> +static int dynticks_start_timer(struct qemu_alarm_timer *t)
> +{
> + struct sigevent ev;
> + timer_t host_timer;
> + struct sigaction act;
> +
> + sigfillset(&act.sa_mask);
> + act.sa_flags = 0;
> +#if defined(TARGET_I386) && defined(USE_CODE_COPY)
> + act.sa_flags |= SA_ONSTACK;
> +#endif
> + act.sa_handler = host_alarm_handler;
> +
> + sigaction(SIGALRM, &act, NULL);
> +
> + ev.sigev_value.sival_int = 0;
> + ev.sigev_notify = SIGEV_SIGNAL;
> + ev.sigev_signo = SIGALRM;
> +
> + if (timer_create(CLOCK_REALTIME, &ev, &host_timer)) {
> + perror("timer_create");
> +
> + /* disable dynticks */
> + fprintf(stderr, "Dynamic Ticks disabled\n");
> +
> + return -1;
> + }
> +
> + t->priv = (void *)host_timer;
> +
> + return 0;
> +}
> +
> +static void dynticks_stop_timer(struct qemu_alarm_timer *t)
> +{
> + timer_t host_timer = (timer_t)t->priv;
> +
> + timer_delete(host_timer);
> +}
> +
> +static void dynticks_rearm_timer(struct qemu_alarm_timer *t)
> +{
> + timer_t host_timer = (timer_t)t->priv;
> + struct itimerspec timeout;
> + int64_t nearest_delta_us = INT64_MAX;
> + int64_t current_us;
> +
> + if (!active_timers[QEMU_TIMER_REALTIME] &&
> + !active_timers[QEMU_TIMER_VIRTUAL])
> + return;
> +
> + nearest_delta_us = qemu_next_deadline();
> +
> + /* check whether a timer is already running */
> + if (timer_gettime(host_timer, &timeout)) {
> + perror("gettime");
> + fprintf(stderr, "Internal timer error: aborting\n");
> + exit(1);
> + }
> + current_us = timeout.it_value.tv_sec * 1000000 + timeout.it_value.tv_nsec/1000;
> + if (current_us && current_us <= nearest_delta_us)
> + return;
> +
> + timeout.it_interval.tv_sec = 0;
> + timeout.it_interval.tv_nsec = 0; /* 0 for one-shot timer */
> + timeout.it_value.tv_sec = nearest_delta_us / 1000000;
> + timeout.it_value.tv_nsec = (nearest_delta_us % 1000000) * 1000;
> + if (timer_settime(host_timer, 0 /* RELATIVE */, &timeout, NULL)) {
> + perror("settime");
> + fprintf(stderr, "Internal timer error: aborting\n");
> + exit(1);
> + }
> +}
> +
> static int unix_start_timer(struct qemu_alarm_timer *t)
> {
> struct sigaction act;
> @@ -1288,6 +1413,7 @@
> {
> TIMECAPS tc;
> struct qemu_alarm_win32 *data = t->priv;
> + UINT flags;
>
> data->host_alarm = CreateEvent(NULL, FALSE, FALSE, NULL);
> if (!data->host_alarm) {
> @@ -1304,11 +1430,17 @@
>
> timeBeginPeriod(data->period);
>
> + flags = TIME_CALLBACK_FUNCTION;
> + if (alarm_has_dynticks(t))
> + flags |= TIME_ONESHOT;
> + else
> + flags |= TIME_PERIODIC;
> +
> data->timerId = timeSetEvent(1, // interval (ms)
> data->period, // resolution
> host_alarm_handler, // function
> (DWORD)t, // parameter
> - TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
> + flags);
>
> if (!data->timerId) {
> perror("Failed to initialize win32 alarm timer");
> @@ -1333,6 +1465,35 @@
> CloseHandle(data->host_alarm);
> }
>
> +static void win32_rearm_timer(struct qemu_alarm_timer *t)
> +{
> + struct qemu_alarm_win32 *data = t->priv;
> + uint64_t nearest_delta_us;
> +
> + if (!active_timers[QEMU_TIMER_REALTIME] &&
> + !active_timers[QEMU_TIMER_VIRTUAL])
> + return;
> +
> + nearest_delta_us = qemu_next_deadline();
> + nearest_delta_us /= 1000;
> +
> + timeKillEvent(data->timerId);
> +
> + data->timerId = timeSetEvent(1,
> + data->period,
> + host_alarm_handler,
> + (DWORD)t,
> + TIME_ONESHOT | TIME_PERIODIC);
> +
> + if (!data->timerId) {
> + perror("Failed to re-arm win32 alarm timer");
> +
> + timeEndPeriod(data->period);
> + CloseHandle(data->host_alarm);
> + exit(1);
> + }
> +}
> +
> #endif /* _WIN32 */
>
> static void init_timer_alarm(void)
> @@ -6491,6 +6652,7 @@
> cpu_enable_ticks();
> vm_running = 1;
> vm_state_notify(1);
> + qemu_rearm_alarm_timer(alarm_timer);
> }
> }
>
>
> Luca
next prev parent reply other threads:[~2007-08-18 23:58 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 23:11 [PATCH 0/4] Rework alarm timer infrastrucure - take 2 Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] " Luca Tettamanti
2007-08-17 23:11 ` [PATCH 1/4] Rework alarm timer infrastrucure Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] " Luca Tettamanti
2007-08-17 23:11 ` [PATCH 2/4] Add -clock option Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] " Luca Tettamanti
2007-08-17 23:11 ` [PATCH 3/4] Add support for HPET periodic timer Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] " Luca Tettamanti
[not found] ` <20070817231406.493008599-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-08-21 19:24 ` Matthew Kent
2007-08-21 19:24 ` Matthew Kent
2007-08-21 19:40 ` Luca
2007-08-21 19:40 ` Luca
[not found] ` <68676e00708211240k7237bf21k131257dd28063d26-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-21 20:15 ` Matthew Kent
2007-08-21 20:15 ` Matthew Kent
2007-08-22 6:48 ` Dan Kenigsberg
2007-08-22 6:48 ` [kvm-devel] " Dan Kenigsberg
[not found] ` <20070822064851.GA16295-RO/WWmT55CHJJbofclyLPCHBx9XpghdU@public.gmane.org>
2007-08-22 7:03 ` Avi Kivity
2007-08-22 7:03 ` [kvm-devel] " Avi Kivity
[not found] ` <46CBDFC4.5060207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-22 12:34 ` Andi Kleen
2007-08-22 12:34 ` [kvm-devel] " Andi Kleen
[not found] ` <20070822123424.GK2642-KvMlXPVkKihbpigZmTR7Iw@public.gmane.org>
2007-08-22 21:11 ` Dan Kenigsberg
2007-08-22 21:11 ` [kvm-devel] " Dan Kenigsberg
[not found] ` <20070822211150.GA22093-RO/WWmT55CHJJbofclyLPCHBx9XpghdU@public.gmane.org>
2007-08-22 22:09 ` Andi Kleen
2007-08-22 22:09 ` [kvm-devel] " Andi Kleen
[not found] ` <20070822220947.GK8058-KvMlXPVkKihbpigZmTR7Iw@public.gmane.org>
2007-08-23 7:02 ` Dan Kenigsberg
2007-08-23 7:02 ` [kvm-devel] " Dan Kenigsberg
[not found] ` <20070823070230.GA24942-RO/WWmT55CHJJbofclyLPCHBx9XpghdU@public.gmane.org>
2007-08-24 20:18 ` Luca
2007-08-24 20:18 ` [kvm-devel] " Luca
2007-08-25 8:24 ` Dan Kenigsberg
2007-09-03 8:40 ` GUERRAZ Francois
2007-08-17 23:11 ` [PATCH 4/4] Add support for dynamic ticks Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] " Luca Tettamanti
[not found] ` <20070817231149.544849769-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-08-17 23:48 ` [Qemu-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take 2 Christian MICHON
2007-08-17 23:48 ` Christian MICHON
[not found] ` <46d6db660708171648m3a798685q6514261bc097bc62-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-18 0:10 ` Luca
2007-08-18 0:10 ` [kvm-devel] " Luca
2007-08-18 15:17 ` Anthony Liguori
2007-08-18 15:17 ` [Qemu-devel] Re: [kvm-devel] " Anthony Liguori
2007-08-18 16:53 ` [PATCH 0/4] Rework alarm timer infrastrucure - take2 Dor Laor
2007-08-18 16:53 ` [Qemu-devel] RE: [kvm-devel] " Dor Laor
[not found] ` <64F9B87B6B770947A9F8391472E032160D4645F0-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
2007-08-18 22:02 ` Luca Tettamanti
2007-08-18 22:02 ` [Qemu-devel] Re: [kvm-devel] " Luca Tettamanti
[not found] ` <20070818220252.GA19526-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
2007-08-18 23:58 ` Anthony Liguori [this message]
2007-08-18 23:58 ` Anthony Liguori
2007-08-19 7:36 ` [PATCH 0/4] Rework alarm timer infrastrucure -take2 Dor Laor
2007-08-19 7:36 ` [Qemu-devel] RE: [kvm-devel] " Dor Laor
2007-08-19 8:24 ` [PATCH 0/4] Rework alarm timer infrastrucure - take2 Avi Kivity
2007-08-19 8:24 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46C7FE32.4050309-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-19 13:10 ` [Qemu-devel] " Jamie Lokier
2007-08-19 13:10 ` [Qemu-devel] Re: [kvm-devel] " Jamie Lokier
[not found] ` <20070819131042.GA22798-tp2ajI7sM85Y6zH9YvfY1x2eb7JE58TQ@public.gmane.org>
2007-08-19 13:48 ` [Qemu-devel] " Avi Kivity
2007-08-19 13:48 ` [kvm-devel] " Avi Kivity
[not found] ` <46C84A16.7040305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-19 13:57 ` Paul Brook
2007-08-19 13:57 ` [kvm-devel] " Paul Brook
[not found] ` <200708191457.21237.paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>
2007-08-19 14:07 ` Avi Kivity
2007-08-19 14:07 ` [kvm-devel] " Avi Kivity
[not found] ` <46C84E95.7070802-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-19 14:27 ` Dor Laor
2007-08-19 14:27 ` [kvm-devel] " Dor Laor
2007-08-20 9:25 ` Avi Kivity
2007-08-20 9:25 ` [kvm-devel] " Avi Kivity
2007-08-19 17:15 ` Jamie Lokier
2007-08-19 17:15 ` [kvm-devel] " Jamie Lokier
[not found] ` <20070819171545.GB16928-tp2ajI7sM85Y6zH9YvfY1x2eb7JE58TQ@public.gmane.org>
2007-08-19 19:29 ` [Qemu-devel] Re: [PATCH 0/4] Rework alarmtimer " Dor Laor
2007-08-19 19:29 ` [kvm-devel] " Dor Laor
2007-08-19 19:30 ` [Qemu-devel] Re: [PATCH 0/4] Rework alarm timer " Avi Kivity
2007-08-19 19:30 ` [kvm-devel] " Avi Kivity
2007-08-19 16:52 ` Luca
2007-08-19 16:52 ` [Qemu-devel] Re: [kvm-devel] " Luca
[not found] ` <68676e00708190952g7d4751c2g87a6ff71dd278f71-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-19 19:31 ` Avi Kivity
2007-08-19 19:31 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46C89A8E.7040609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-20 21:20 ` Luca Tettamanti
2007-08-20 21:20 ` [Qemu-devel] Re: [kvm-devel] " Luca Tettamanti
[not found] ` <20070820212058.GA6713-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
2007-08-20 21:55 ` [Qemu-devel] " malc
2007-08-20 21:55 ` [Qemu-devel] Re: [kvm-devel] " malc
[not found] ` <Pine.LNX.4.64.0708210140540.16421-KsBd/I2zj1m2ZGm1qqSgDg@public.gmane.org>
2007-08-20 22:49 ` [Qemu-devel] " Luca
2007-08-20 22:49 ` [kvm-devel] " Luca
2007-08-21 12:09 ` Avi Kivity
2007-08-21 12:09 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46CAD607.2080504-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-21 19:38 ` Luca Tettamanti
2007-08-21 19:38 ` [Qemu-devel] Re: [kvm-devel] " Luca Tettamanti
[not found] ` <20070821193834.GB13544-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
2007-08-21 19:44 ` malc
2007-08-21 19:44 ` [Qemu-devel] Re: [kvm-devel] " malc
2007-08-22 5:02 ` Avi Kivity
2007-08-22 5:02 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46CBC34F.6060601-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-22 16:12 ` Luca Tettamanti
2007-08-22 16:12 ` [Qemu-devel] Re: [kvm-devel] " Luca Tettamanti
[not found] ` <20070822161211.GA30147-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
2007-08-22 16:21 ` Avi Kivity
2007-08-22 16:21 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46CC6285.3090904-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-22 16:38 ` Luca
2007-08-22 16:38 ` [Qemu-devel] Re: [kvm-devel] " Luca
[not found] ` <68676e00708220938y57c07edas705fc8360aefcb78-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-22 16:45 ` Avi Kivity
2007-08-22 16:45 ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
[not found] ` <46CC680C.1030307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-22 17:23 ` Luca
2007-08-22 17:23 ` [Qemu-devel] Re: [kvm-devel] " Luca
[not found] ` <68676e00708221023m352c2de3y3b19188dbb9ef49e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-22 17:39 ` Luca
2007-08-22 17:39 ` [Qemu-devel] Re: [kvm-devel] " Luca
2007-08-22 19:21 ` Luca
2007-08-22 19:21 ` [Qemu-devel] Re: [kvm-devel] " Luca
[not found] ` <68676e00708221221n6f8fcd67m9d15f7fea663ec71-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-22 21:35 ` Dor Laor
2007-08-22 21:35 ` [Qemu-devel] RE: [kvm-devel] " Dor Laor
[not found] ` <64F9B87B6B770947A9F8391472E032160D5042F3-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
2007-08-22 22:07 ` Luca
2007-08-22 22:07 ` [Qemu-devel] Re: [kvm-devel] " Luca
2007-08-22 20:42 ` Dan Kenigsberg
2007-08-22 20:42 ` [Qemu-devel] Re: [kvm-devel] " Dan Kenigsberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1187481505.15472.3.camel@squirrel \
--to=anthony-rdkfgonbjusknkdkm+me6a@public.gmane.org \
--cc=kronos.it-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-TtF/mJH4Jtrk1uMJSBkQmQ@public.gmane.org \
--cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.