Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp906797pxb; Wed, 6 Apr 2022 03:56:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwum+iZ3xoSYjhO4nM8Kx4b8QUaD/QSqEHeadxJuVP7Mv5H6yxcX7gnFlvgbBpwVRTk2+oS X-Received: by 2002:aa7:8889:0:b0:4fd:aae0:a94c with SMTP id z9-20020aa78889000000b004fdaae0a94cmr8126173pfe.76.1649242600231; Wed, 06 Apr 2022 03:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649242600; cv=none; d=google.com; s=arc-20160816; b=uVTaw5TX4kxF7vSF1scA7bJs0oMijjqXZdQCNV03R/Vrcpp8CCZt8AC8/0+HmRFTQz LW9OxjnIEIteZPxW4sP6W0CJwZBctMv48hYJKnDmqEXGjGdrhphfiRusULWHnBIcR7h6 IjymggXvnw9wsMQcTtPWqJx5gJ65fm03Fukz9Q5dU0JfY0vWfKC5nv6f6VdWToBWPw90 uT86ljSVsVNYhS/1tq4vCsfEJK13axSDj3rBcCNlPHdQq0wzAZfX0qI3uxUARHBwleSW hmVqU7AToz2EndCIbuNhHO7i7Z8FLrYxcpDkKJf2J1hLgeB/NF7h8LRE2V15NjJ78Ypu oC7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kwp01BSiU6IaDx1NTWvzh3k14rr4fIzyUHOYs+ODIf0=; b=tzGGeARgU/hAnwU19kcG4u50qtl/S/stFarOAgJ9o88rk1JgbeEsxfBTwqCA1pjWpr ykMt1uDDPa1hKP80HX/svnuCDK6eKIvLYWEX31rgRwsxwHqjayhz8rRdKOaB4+BfJlq6 9fSZotXEuQApsgUyAB88ELR3qf8P4A490CrO+vxf4zffUEMhY7xZEfu4UxWAeC//Sa+3 d44tJTe6pz3VY7kTxTuUywt7YVxQg9FJ1lJCyJol5pkK1arPOCl418MhnruMlubfw02o 8iY/ckxQkCmb2gwO0VQ0rWwWNKSxFWa9nYsj05Q6e0tcDcA+13s7w0gOUAf+/bN7lsd+ dRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LgKGn7O+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e22-20020a635456000000b003816043f09dsi15204294pgm.658.2022.04.06.03.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 03:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LgKGn7O+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1CA93E8E73; Wed, 6 Apr 2022 02:14:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235388AbiDEUmp (ORCPT + 99 others); Tue, 5 Apr 2022 16:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349097AbiDEJtH (ORCPT ); Tue, 5 Apr 2022 05:49:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF4EA997E; Tue, 5 Apr 2022 02:40:49 -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 CE3F1615E5; Tue, 5 Apr 2022 09:40:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF164C385A2; Tue, 5 Apr 2022 09:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151648; bh=rxHQsFLtgiC6ynAr/G0LJGWLVUyFleSmT1QUVei06mU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LgKGn7O+sgGl9WUA54hx0LIKOPUc2Y5w7v3uxkmpGIO00GHjJPYsBniAYNJkhEKzM hy+w4d5DgRrcMaT4sKiUy0NwALqmzWO94r7/vqJjIAHz0p1pEzmF0Jg6F6gJ14Pt5j 7NQwgD9ZtpOfICcHnNZH7HDPwYGuKzXnl3XQ8NBI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aharon Landau , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.15 490/913] RDMA/mlx5: Fix the flow of a miss in the allocation of a cache ODP MR Date: Tue, 5 Apr 2022 09:25:52 +0200 Message-Id: <20220405070354.542717445@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aharon Landau [ 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@nvidia.com Signed-off-by: Aharon Landau Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/mr.c | 2 ++ 1 file changed, 2 insertions(+) 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)) -- 2.34.1