diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2020-03-10 10:22:36 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-03-13 11:08:02 -0300 |
commit | b9358bdbc713cb64b8701bcbd450edc155d761a1 (patch) | |
tree | cdb14497a0fed7d6d9121dbcaedb5bd6e38f47ed /Documentation | |
parent | ad2d3ef46d2a88f2906d8d0cc6b912199ec3f1d6 (diff) |
RDMA/mlx5: Fix locking in MR cache work queue
All of the members of mlx5_cache_ent must be accessed while holding the
spinlock, add the missing spinlock in the __cache_work_func().
Using cache->stopped and flush_workqueue() is an inherently racy way to
shutdown self-scheduling work on a queue. Replace it with ent->disabled
under lock, and always check disabled before queuing any new work. Use
cancel_work_sync() to shutdown the queue.
Use READ_ONCE/WRITE_ONCE for dev->last_add to manage concurrency as
coherency is less important here.
Split fill_delay from the bitfield. C bitfield updates are not atomic and
this is just a mess. Use READ_ONCE/WRITE_ONCE, but this could also use
test_bit()/set_bit().
Link: https://lore.kernel.org/r/20200310082238.239865-11-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions