]> xenbits.xensource.com Git - qemu-xen-4.1-testing.git/commitdiff
qemu-xen: use dynticks instead of a static 10ms timeout xen-4.1.0-rc1
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 11 Jan 2011 18:48:58 +0000 (18:48 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 11 Jan 2011 18:48:58 +0000 (18:48 +0000)
Use dynticks instead of polling the timers every 10ms.
This allows a qemu running in dom0 to wake up only when the next timer
goes off (that is every 100ms, because of the buffer_io_timer) instead
of every 10ms.

For the moment stubdoms still run with the old 10ms timeout because
minios doesn't support the posix timer_create interface yet.

Also disable the nographic_timer when CONFIG_DM because it is only
useful with tcg.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
i386-dm/helper2.c
vl.c

index 4993f1e52b548837d4745713334ea6347221d4ce..481c620f91bfd885f338f4cc50ff3aea9ea32a2c 100644 (file)
@@ -572,8 +572,13 @@ int main_loop(void)
 
     while (1) {
         while (!(vm_running && xen_pause_requested))
+#ifdef CONFIG_STUBDOM
             /* Wait up to 10 msec. */
             main_loop_wait(10);
+#else
+            /* Wait up to 10s. */
+            main_loop_wait(10000);
+#endif
 
         fprintf(logfile, "device model saving state\n");
 
diff --git a/vl.c b/vl.c
index 2ee9aeee610f3cd00c242d49506ea80017af277b..5f48e1f30e8f2a67cc4b91f9b8c37148c4a8fd5a 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -942,7 +942,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t);
 static int unix_start_timer(struct qemu_alarm_timer *t);
 static void unix_stop_timer(struct qemu_alarm_timer *t);
 
-#if defined(__linux__) && !defined(CONFIG_DM)
+#if defined(__linux__)
 
 static int dynticks_start_timer(struct qemu_alarm_timer *t);
 static void dynticks_stop_timer(struct qemu_alarm_timer *t);
@@ -1025,7 +1025,7 @@ static void init_icount_adjust(void)
 
 static struct qemu_alarm_timer alarm_timers[] = {
 #ifndef _WIN32
-#if defined(__linux__) && !defined(CONFIG_DM)
+#if defined(__linux__)
     {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer,
      dynticks_stop_timer, dynticks_rearm_timer, NULL},
     /* HPET - if available - is preferred */
@@ -1327,7 +1327,6 @@ static int timer_load(QEMUFile *f, void *opaque, int version_id)
     return 0;
 }
 
-#ifndef CONFIG_DM /* ends just before fcntl_setfl */
 #ifdef _WIN32
 void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg,
                                  DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
@@ -1436,7 +1435,6 @@ static uint64_t qemu_next_deadline_dyntick(void)
     return delta;
 }
 #endif
-#endif
 
 #ifndef _WIN32
 
@@ -1455,7 +1453,6 @@ static int fcntl_setfl(int fd, int flag)
     return 0;
 }
 
-#ifndef CONFIG_DM /* ends after end of win32_rearm_timer */
 #if defined(__linux__)
 
 #define RTC_FREQ 1024
@@ -1632,6 +1629,7 @@ static void dynticks_rearm_timer(struct qemu_alarm_timer *t)
 
 #endif /* defined(__linux__) */
 
+#ifndef CONFIG_STUBDOM
 static int unix_start_timer(struct qemu_alarm_timer *t)
 {
     struct sigaction act;
@@ -1665,8 +1663,11 @@ static void unix_stop_timer(struct qemu_alarm_timer *t)
     memset(&itv, 0, sizeof(itv));
     setitimer(ITIMER_REAL, &itv, NULL);
 }
+#else
+static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; }
+static void unix_stop_timer(struct qemu_alarm_timer *t) { }
+#endif
 
-#endif /* !defined(_WIN32) */
 
 static void try_to_rearm_timer(void *opaque)
 {
@@ -6024,10 +6025,12 @@ int main(int argc, char **argv, char **envp)
         dcl = dcl->next;
     }
 
+#ifndef CONFIG_DM
     if (nographic || (vnc_display && !sdl)) {
         nographic_timer = qemu_new_timer(rt_clock, nographic_update, NULL);
         qemu_mod_timer(nographic_timer, qemu_get_clock(rt_clock));
     }
+#endif
 
     text_consoles_set_display(display_state);
     qemu_chr_initial_reset();
@@ -6162,6 +6165,3 @@ int main(int argc, char **argv, char **envp)
 
     return 0;
 }
-
-static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; }
-static void unix_stop_timer(struct qemu_alarm_timer *t) { }