Skip to content
  • Paolo Bonzini's avatar
    7c9b2bf6
    qemu-thread: add a fast path to the Win32 QemuEvent · 7c9b2bf6
    Paolo Bonzini authored
    
    
    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.
    
    Tested-by: default avatarStefan Weil <sw@weilnetz.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    7c9b2bf6
    qemu-thread: add a fast path to the Win32 QemuEvent
    Paolo Bonzini authored
    
    
    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.
    
    Tested-by: default avatarStefan Weil <sw@weilnetz.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
Loading