[RFC PATCH v3 7/8] vhost: annotate IOTLB locks
Maxime Coquelin
maxime.coquelin at redhat.com
Fri Apr 22 09:46:44 CEST 2022
On 4/11/22 13:00, David Marchand wrote:
> This change simply annotates existing paths of the code leading to
> manipulations of the IOTLB r/w locks.
>
> clang does not support conditionally held locks, so always take iotlb
> locks regardless of VIRTIO_F_IOMMU_PLATFORM feature.
>
> vdpa and vhost_crypto code are annotated though they end up not taking
> a IOTLB lock and have been marked with a FIXME.
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> lib/vhost/iotlb.h | 8 +++++++
> lib/vhost/vdpa.c | 1 +
> lib/vhost/vhost.c | 11 +++++----
> lib/vhost/vhost.h | 22 +++++++++++++-----
> lib/vhost/vhost_crypto.c | 7 ++++++
> lib/vhost/virtio_net.c | 49 ++++++++++++++++++++++++++++++----------
> 6 files changed, 75 insertions(+), 23 deletions(-)
>
I agree with the change. I don't expect performance impact of taking the
lock unconditionally, because there won't be cache line sharing since it
is per-vq lock and the locking cost will be offset by removing the
feature check.
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Thanks,
Maxime
More information about the dev
mailing list