Skip to content

Commit

Permalink
KVM: document lock orders
Browse files Browse the repository at this point in the history
This is long overdue, and not really hard.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1476357057-17899-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Paolo Bonzini committed Oct 27, 2016
1 parent 36343f6 commit 58e3948
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Documentation/virtual/kvm/locking.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ KVM Lock Overview
1. Acquisition Orders
---------------------

(to be written)
The acquisition orders for mutexes are as follows:

- kvm->lock is taken outside vcpu->mutex

- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock

- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
them together is quite rare.

For spinlocks, kvm_lock is taken outside kvm->mmu_lock. Everything
else is a leaf: no other lock is taken inside the critical sections.

2: Exception
------------
Expand Down

0 comments on commit 58e3948

Please sign in to comment.