base-hw: Virtualbox thread priorities

Norman Feske norman.feske at ...1...
Wed Jul 15 17:50:31 CEST 2015


Hello,

while spending some days out of office, I kept thinking about your
performance issue. Could it possibly be related to the spinlock that we
use to protect the lock metadata? See [1] and [2] for the lock
implementation.

I remember when Alex first introduced the use of multiple priorities
within a single component (which was actually VirtualBox), we stumbled
over the issue that a high-priority thread would eventually keep
spinning on a contended spinlock. The spinlock holder, however, was
never scheduled anymore because it had a lower priority than the lock
applicant. Alex addressed this issue with a NOVA-specific spinlock that
maintains priority inheritance. See [3].

[1]
https://github.com/genodelabs/genode/blob/master/repos/base/include/base/cancelable_lock.h
[2]
https://github.com/genodelabs/genode/blob/master/repos/base/src/base/lock/lock.cc
[3]
https://github.com/genodelabs/genode/blob/master/repos/base-nova/src/base/lock/spin_lock.h

It would be interesting to see the spinlock-holding times of the lock's
spinlock (by taking rdtsc values when acquiring and releasing the
spinlock) in your version of VirtualBox on base-hw/Muen. One would
expect the hold times to be just the few cycles. If they are orders of
magnitudes higher, we'd need to consider a priority-inheriting spinlock
for base-hw.

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list