LKML Archive on
help / color / mirror / Atom feed
From: Leon Romanovsky <>
To: Doug Ledford <>, Jason Gunthorpe <>
Cc: Aharon Landau <>,,,
	Maor Gottlieb <>
Subject: [PATCH rdma-rc] RDMA/mlx5: Delay emptying a cache entry when a new MR is added to it recently
Date: Tue, 27 Jul 2021 10:16:06 +0300	[thread overview]
Message-ID: <> (raw)

From: Aharon Landau <>

Fixing a typo that causes a cache entry to shrink immediately after
adding to it new MRs if the entry size exceeds the high limit.
In doing so, the cache misses its purpose to prevent the creation of new
mkeys on the runtime by using the cached ones.

Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue")
Signed-off-by: Aharon Landau <>
Reviewed-by: Maor Gottlieb <>
Signed-off-by: Leon Romanovsky <>
 drivers/infiniband/hw/mlx5/mr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 3263851ea574..3f1c5a4f158b 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -531,8 +531,8 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
 		need_delay = need_resched() || someone_adding(cache) ||
-			     time_after(jiffies,
-					READ_ONCE(cache->last_add) + 300 * HZ);
+			     !time_after(jiffies,
+					 READ_ONCE(cache->last_add) + 300 * HZ);
 		if (ent->disabled)
 			goto out;

             reply	other threads:[~2021-07-27  7:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  7:16 Leon Romanovsky [this message]
2021-08-03 15:56 ` Jason Gunthorpe

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:

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

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH rdma-rc] RDMA/mlx5: Delay emptying a cache entry when a new MR is added to it recently' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).