vdpa/mlx5: Use readers/writers semaphore instead of mutex
authorEli Cohen <elic@nvidia.com>
Wed, 18 May 2022 13:38:04 +0000 (16:38 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 31 May 2022 16:44:23 +0000 (12:44 -0400)
commit759ae7f9bf1e6b7f5c9c197d7207e2be1dfd74b1
tree38e6e4201e9630c2ea215eab7e691200dba53cca
parent1892a3d425bf525ac98d6d3534035e6ed2bfab50
vdpa/mlx5: Use readers/writers semaphore instead of mutex

Reading statistics could be done intensively and by several processes
concurrently. Reader's lock is sufficient in this case.

Change reslock from mutex to a rwsem.

Suggested-by: Si-Wei Liu <si-wei.liu@oracle.com>
Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20220518133804.1075129-7-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c