qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-thread: add a fast path to the Win32 QemuE


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] qemu-thread: add a fast path to the Win32 QemuEvent
Date: Thu, 10 Sep 2015 21:30:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

Am 10.09.2015 um 18:12 schrieb Paolo Bonzini:
> On 12/08/2015 15:38, Paolo Bonzini wrote:
>> QemuEvents are used heavily by call_rcu.  We do not want them to be slow,
>> but the current implementation does a kernel call on every invocation
>> of qemu_event_* and won't cut it.
>>
>> So, wrap a Win32 manual-reset event with a fast userspace path.  The
>> states and transitions are the same as for the futex and mutex/condvar
>> implementations, but the slow path is different of course.  The idea
>> is to reset the Win32 event lazily, as part of a test-reset-test-wait
>> sequence.  Such a sequence is, indeed, how QemuEvents are used by
>> RCU and other subsystems!
>>
>> The patch includes a formal model of the algorithm.
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>> ---
>>  docs/win32-qemu-event.promela | 98 
>> +++++++++++++++++++++++++++++++++++++++++++
>>  include/qemu/thread-win32.h   |  1 +
>>  util/qemu-thread-win32.c      | 66 +++++++++++++++++++++++++++--
>>  3 files changed, 161 insertions(+), 4 deletions(-)
>>  create mode 100644 docs/win32-qemu-event.promela
>>
[...]
>>
> 
> Ping?
> 

Hello Paolo,

sorry, I did not notice your patch when it was initially sent.

I have just run several passes of a simple test (booting an fdos
image and running a test sequence which involves TCP / downloads
and compilations under fdos) under wine on my KVM server,
so this was not a typical Windows environment.

Command line:

time wine32 i686-w64-mingw32/i386-softmmu/qemu-system-i386 -fda
metados.img -boot a -net nic,model=pcnet -net user -snapshot

Results without patch:

real    3m8.601s
user    1m33.972s
sys     0m29.736s

real    2m25.502s
user    1m28.168s
sys     0m24.640s

Results with patch:

real    2m27.628s
user    1m27.844s
sys     0m13.304s

real    2m0.043s
user    1m22.728s
sys     0m11.004s

Interpretation:

The real time varies because the test includes user
interactions (pressing enter, starting test,
terminating QEMU after test).

The user time (mainly emulation) does not vary much.

The system time is significantly reduced (less than
50 % in both runs with patch compared to both runs
without patch).

I also had an (unrelated) crash with the unpatched code:

wine: Unhandled page fault on read access to 0x0000004c at address
0x43ed3d (thread 0009), starting debugger...

It happened once in three runs, so this needs separate
investigations.

Would you suggest additional tests?
I'll take your patch in my queue (git://qemu.weilnetz.de/qemu.git wxx).

Regards
Stefan

Tested-by: Stefan Weil <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]