Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Aharon Landau <aharonl@nvidia.com>,
	linux-rdma@vger.kernel.org, Maor Gottlieb <maorg@nvidia.com>,
	Mark Zhang <markzhang@nvidia.com>, Shay Drory <shayd@nvidia.com>
Subject: Re: [PATCH rdma-rc 1/3] RDMA/mlx5: Don't remove cache MRs when a delay is needed
Date: Tue, 29 Mar 2022 10:25:08 +0300	[thread overview]
Message-ID: <YkK0VE2fe0HcVCpg@unreal> (raw)
In-Reply-To: <73c3fef51ee2bb50ae240306472d9562ba05916f.1648366974.git.leonro@nvidia.com>

On Sun, Mar 27, 2022 at 10:55:46AM +0300, Leon Romanovsky wrote:
> From: Aharon Landau <aharonl@nvidia.com>
> 
> Don't remove MRs from the cache if need to delay the removal.
> 
> Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue")
> Signed-off-by: Aharon Landau <aharonl@nvidia.com>
> Reviewed-by: Shay Drory <shayd@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index 8a87a2f074e4..4a01a0ad7c90 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -562,9 +562,10 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
>  		spin_lock_irq(&ent->lock);
>  		if (ent->disabled)
>  			goto out;
> -		if (need_delay)
> +		if (need_delay) {
>  			queue_delayed_work(cache->wq, &ent->dwork, 300 * HZ);
> -		remove_cache_mr_locked(ent);

This is rebase error and remove_cache_mr_locked() shouldn't be removed.

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 8a87a2f074e4..fc5bc8ff1c57 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -562,8 +562,10 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
                spin_lock_irq(&ent->lock);
                if (ent->disabled)
                        goto out;
-               if (need_delay)
+               if (need_delay) {
                        queue_delayed_work(cache->wq, &ent->dwork, 300 * HZ);
+                       goto out;
+               }
                remove_cache_mr_locked(ent);
                queue_adjust_cache_locked(ent);
        }


> +			goto out;
> +		}
>  		queue_adjust_cache_locked(ent);
>  	}
>  out:
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-03-29  7:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27  7:55 [PATCH rdma-rc 0/3] Fixes for v5.17 Leon Romanovsky
2022-03-27  7:55 ` [PATCH rdma-rc 1/3] RDMA/mlx5: Don't remove cache MRs when a delay is needed Leon Romanovsky
2022-03-29  7:25   ` Leon Romanovsky [this message]
2022-03-27  7:55 ` [PATCH rdma-rc 2/3] RDMA/mlx5: Add a missing update of cache->last_add Leon Romanovsky
2022-03-27  7:55 ` [PATCH rdma-rc 3/3] IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkK0VE2fe0HcVCpg@unreal \
    --to=leon@kernel.org \
    --cc=aharonl@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=markzhang@nvidia.com \
    --cc=shayd@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox