Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/mlx5: Don't remove cache MRs when a delay is needed

Don't remove MRs from the cache if need to delay the removal.

Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue")
Link: https://lore.kernel.org/r/c3087a90ff362c8796c7eaa2715128743ce36722.1649062436.git.leonro@nvidia.com
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Aharon Landau and committed by
Jason Gunthorpe
84c2362f abcc160e

+3 -1
+3 -1
drivers/infiniband/hw/mlx5/mr.c
··· 574 574 spin_lock_irq(&ent->lock); 575 575 if (ent->disabled) 576 576 goto out; 577 - if (need_delay) 577 + if (need_delay) { 578 578 queue_delayed_work(cache->wq, &ent->dwork, 300 * HZ); 579 + goto out; 580 + } 579 581 remove_cache_mr_locked(ent); 580 582 queue_adjust_cache_locked(ent); 581 583 }