Re: [PATCH] Lazy FPU save/restore

Avi Kivity
2007-02-18T18:21:11Z

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

Avi Kivity wrote:
>>
>> I'll have to try and setup a 64 bit system. I cannot reproduce on my
>> 32bit system with your test program.
>
> It may be related to 64-bit (as that uses sse for floating point), or
> to the fact that I use ssh on a remote host, which causes more context
> switches. I'll try to reproduce on 32 bits with my setup.
>

It doesn't reproduce on a 32-bit host. However, it does reproduce on a
32-bit guest on a 64-bit host, and on a 32-bit user load running in a
64-bit guest on a 64-bit host.

I'm attaching an updated test program which makes it easier to spot the
failures. You only need to run it on the guest, although running it on
the host as well increases the failure rate significantly.

--
error compiling committee.c: too many arguments to function

[-- Attachment #2: fpu.c --]
[-- Type: text/x-csrc, Size: 506 bytes --]

#include <stdio.h>
#include <math.h>

double test_fpu_once()
{
int i;
double f = 0;

for (i = 0; i < 10000000; ++i)
f += 1 / (1.0 + i);
return f;
}

void test_fpu()
{
double a, b;
int runs;

runs = 0;
a = test_fpu_once();
while (1) {
b = test_fpu_once();
if (fabs(a - b) > 1e-9)
printf("error: %20.16f -> %20.16f\n", a, b);
a = b;
if (++runs % 100 == 0)
printf("runs: %8d\n", runs);
}
}

int main(int ac, char **av)
{
test_fpu();
return 0;
}

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org