From patchwork Mon Apr 4 08:58:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 12800020 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CADCC433FE for ; Mon, 4 Apr 2022 08:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245350AbiDDJAL (ORCPT ); Mon, 4 Apr 2022 05:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235945AbiDDJAK (ORCPT ); Mon, 4 Apr 2022 05:00:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C233BA4D for ; Mon, 4 Apr 2022 01:58:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 580A1611E0 for ; Mon, 4 Apr 2022 08:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4415CC340EE; Mon, 4 Apr 2022 08:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649062694; bh=NfT6Qn535A1/iKirs09BQOj287UZljjGAEfRtW3B3Mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gk1BmQwNYoX55ylEYs/ma5UpVbJ1nrC1keCyY7L+xIMAx5Km6ALCUcBymgtkJem55 6AP//FrooXGVv5ySb7AQZL5Im1ACOf59c2u4qYqGrr9OKpj+qO2TMeaiH958DCYLxv 7GcEJPPlRfTXZq24ujCuUSJHz7PnBo0vtHBx1lhHdGTE8qAddTRTpCNfUIqa1lPivv L68jA35uhc8D3I1VtB7WyuhX7R1qF2cOArWwglLyGnTWMmTUwtWh6fqDSU4qrFUZrK EzwtqLTNY+Gco6X4uP5MD9TtXbTigtFI6IENRbNorGZea1p6OVNAL1aov1+14gJJgP nO+wm6chhFULA== From: Leon Romanovsky To: Jason Gunthorpe Cc: Aharon Landau , linux-rdma@vger.kernel.org, Maor Gottlieb , Mark Zhang , Shay Drory Subject: [PATCH rdma-rc v1 2/3] RDMA/mlx5: Add a missing update of cache->last_add Date: Mon, 4 Apr 2022 11:58:04 +0300 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Aharon Landau Update cache->last_add when returning an MR to the cache so that the cache work won't remove it. Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue") Signed-off-by: Aharon Landau Reviewed-by: Shay Drory Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/mr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 45b0680377ec..32ef67e9a6a7 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -627,6 +627,7 @@ static void mlx5_mr_cache_free(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) { struct mlx5_cache_ent *ent = mr->cache_ent; + WRITE_ONCE(dev->cache.last_add, jiffies); spin_lock_irq(&ent->lock); list_add_tail(&mr->list, &ent->head); ent->available_mrs++;