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 <pbonz...@redhat.com> >> --- >> 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 <s...@weilnetz.de>