I left over night  following simple app which runs inside linux VM (pinned to 
CPU1). and displays how much ticks happened during the 1 second sleep. I found 
several occasions where sleep was taking much longer.

code:

#include<sys/time.h>
#include<time.h>
#include<stdio.h>
#include<stdint.h>

#define CPUSPEED 2533422000

static __inline__ uint64_t getticks(void)
{
     unsigned a, d;
     asm("cpuid");
     asm volatile("rdtsc" : "=a" (a), "=d" (d));
     return (((uint64_t)a) | (((uint64_t)d) << 32));
}
int main()
{
        uint64_t t0,t1;
        while (1) {
                t0 = getticks();
                sleep(1);
                t1 = getticks();
                printf("Ticks: %lu delta:%lu\n",t1-t0, t1-t0-CPUSPEED);
        }
        return 0;
}


Sample1: 
Ticks: 2533748354 delta:326354
Ticks: 2533785458 delta:363458
Ticks: 2533889852 delta:467852
Ticks: 13309910165 delta:10776488165
Ticks: 2533823762 delta:401762
Ticks: 2533817164 delta:395164
Ticks: 2533894302 delta:472302


Sample2:
Ticks: 2533896753 delta:474753
Ticks: 2533876689 delta:454689
Ticks: 2533783931 delta:361931
Ticks: 20528401242 delta:17994979242
Ticks: 2533904102 delta:482102
Ticks: 2533740733 delta:318733
Ticks: 2533856266 delta:434266


Sample3:
Ticks: 2533761095 delta:339095
Ticks: 2533652242 delta:230242
Ticks: 2533855141 delta:433141
Ticks: 18943955180 delta:16410533180
Ticks: 2533780954 delta:358954
Ticks: 2533923283 delta:501283
Ticks: 2533909033 delta:487033

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1307473

Title:
  guest hang due to missing clock interrupt

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1307473/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to