diff options
author | Dmitry Torokhov | 2023-07-14 15:45:33 -0700 |
---|---|---|
committer | Alex Williamson | 2023-08-03 12:01:56 -0600 |
commit | 73e2f19da50857a3488f44a7c9d874fed6fae533 (patch) | |
tree | 1fada3117e1a97eabf0eef97d35ab43b962fae8a /drivers | |
parent | 9e0f4f2918c2ff145d3dedee862d9919a6ed5812 (diff) |
kvm/vfio: avoid bouncing the mutex when adding and deleting groups
Stop taking kv->lock mutex in kvm_vfio_update_coherency() and instead
call it with this mutex held: the callers of the function usually
already have it taken (and released) before calling
kvm_vfio_update_coherency(). This avoid bouncing the lock up and down.
The exception is kvm_vfio_release() where we do not take the lock, but
it is being executed when the very last reference to kvm_device is being
dropped, so there are no concerns about concurrency.
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20230714224538.404793-2-dmitry.torokhov@gmail.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions