diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-13 07:10:57 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-27 05:35:47 -0400 |
commit | 58e3948a87e39289aeda5753e9712092c8ca0745 (patch) | |
tree | a9b200b62b48ac44c5326c4c9fa95f9bf2ed96a0 /Documentation | |
parent | 36343f6ea721e003ed11b48a6a05d77a255b3a62 (diff) |
KVM: document lock orders
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>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/virtual/kvm/locking.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/kvm/locking.txt index f2491a8c68b4..e5dd9f4d6100 100644 --- a/Documentation/virtual/kvm/locking.txt +++ b/Documentation/virtual/kvm/locking.txt | |||
@@ -4,7 +4,17 @@ KVM Lock Overview | |||
4 | 1. Acquisition Orders | 4 | 1. Acquisition Orders |
5 | --------------------- | 5 | --------------------- |
6 | 6 | ||
7 | (to be written) | 7 | The acquisition orders for mutexes are as follows: |
8 | |||
9 | - kvm->lock is taken outside vcpu->mutex | ||
10 | |||
11 | - kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock | ||
12 | |||
13 | - kvm->slots_lock is taken outside kvm->irq_lock, though acquiring | ||
14 | them together is quite rare. | ||
15 | |||
16 | For spinlocks, kvm_lock is taken outside kvm->mmu_lock. Everything | ||
17 | else is a leaf: no other lock is taken inside the critical sections. | ||
8 | 18 | ||
9 | 2: Exception | 19 | 2: Exception |
10 | ------------ | 20 | ------------ |