Patch "RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-mlx5-fix-the-flow-of-a-miss-in-the-allocation-o.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6d59f595775debd70ea144ea51e89ab050d53ed4
Author: Aharon Landau <aharonl@xxxxxxxxxx>
Date:   Tue Feb 15 19:55:30 2022 +0200

    RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR
    
    [ Upstream commit 2f0e60d5e9f96341a0c8a01be8878cdb3b29ff20 ]
    
    When an ODP MR cache entry is empty and trying to allocate it, increment
    the ent->miss counter and call to queue_adjust_cache_locked() to verify
    the entry is balanced.
    
    Fixes: aad719dcf379 ("RDMA/mlx5: Allow MRs to be created in the cache synchronously")
    Link: https://lore.kernel.org/r/09503e295276dcacc92cb1d8aef1ad0961c99dc1.1644947594.git.leonro@xxxxxxxxxx
    Signed-off-by: Aharon Landau <aharonl@xxxxxxxxxx>
    Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 22e2f4d79743..7bb1b9d0941c 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -580,6 +580,8 @@ struct mlx5_ib_mr *mlx5_mr_cache_alloc(struct mlx5_ib_dev *dev,
 	ent = &cache->ent[entry];
 	spin_lock_irq(&ent->lock);
 	if (list_empty(&ent->head)) {
+		queue_adjust_cache_locked(ent);
+		ent->miss++;
 		spin_unlock_irq(&ent->lock);
 		mr = create_cache_mr(ent);
 		if (IS_ERR(mr))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux