Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp518189rdf; Tue, 21 Nov 2023 08:41:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEc5edyJLbeJJsNO66KyWozsx6YE0Hn0cZyQOAQyGb0KcJ4hNL/z/FfpaWe20FDPAQ7xNyi X-Received: by 2002:a05:6a20:4427:b0:188:bcf1:c218 with SMTP id ce39-20020a056a20442700b00188bcf1c218mr11169605pzb.60.1700584870603; Tue, 21 Nov 2023 08:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700584870; cv=none; d=google.com; s=arc-20160816; b=w7q8cJRuFcv93z5G18e3cy2P7i6mgWkpRoyh48QHbbErOgJNusui1//T3F2M0myQvn Qt4xiXIPXsCfVC8RJIvqvFa2GnkaeiuEuI6UEqwHajUckC+/zPRrZeT4ZyJbwBE+IkpY 4JEX+y417TPMnIwU8uaeQFSGmJopxBDAIlL0qU56cFp63S9KzOg0MGnR/3VI+ftMFp5a 2/PR38nLGiTXwpsv9BEPY9Efa4sc4aUdK5v48eijabkdMGfUdgqbi2sI5rO89FJ/iNpi mdBArbgjyh1ZpDV0pK8PVnrfUQVx9oOMy8xznj35EVB1RXvUO3qE8U5DuUQIG+fePM6R B2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:cc:to:from:subject:dkim-signature; bh=0y7X1pO+La7qvdtgNG75ZSSdf824wXjecL7sOJyiL+0=; fh=ckZOnuavOce67CxFsxbWAkDFDgnVrD8nvvkVrKxmLnw=; b=FuFEi8wy/VJLDsaIDZVSDk6WykUAXsNcHchNef9xnZ/rR3BiVYBWqOG8doT8ChzrDz S4hUKDQX8Fih8LVtS8ky89djR7vdlnL4OB9fg4U+cai77kBkAeCHKbtrPFR3VBplgbSh Cx5yW8TcSlOCNqTJL6YHOy9tT6/0wlZCVb0A8IJBe+GrIa2tMXa2bnI/J/VJVGXqt0Ig gmfPMCRVA5VTqaof1X7m4I3i4QDirJadUC1fwl9R7M1r9MmIbMOqpffwRNiYnloJ+yCK ZYWHViSvYmW3OYctSYI01RIzmgGNbwLLmbhsGehfR11fDe8+mide+G4sYWM9YZQEMQMv 2LjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9ks28JN; spf=pass (google.com: domain of linux-nfs+bounces-17-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-17-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q20-20020a056a00151400b006cb63c86cc2si7460015pfu.100.2023.11.21.08.41.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:41:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-17-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9ks28JN; spf=pass (google.com: domain of linux-nfs+bounces-17-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-17-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 57067B21CF6 for ; Tue, 21 Nov 2023 16:40:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86235495DC; Tue, 21 Nov 2023 16:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L9ks28JN" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 361E048CD2; Tue, 21 Nov 2023 16:40:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40347C433C9; Tue, 21 Nov 2023 16:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700584847; bh=sY0QBw/CFVc90IX3+9inmZeJI9yFyDQM40EBsVYTdLQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=L9ks28JNYLMfIBdKEzRYSWrv6gzfryB1JO9su922nrT2632MdjpUNeBpY50cvfpvg R3vUD/Y7rIhIuYMjHWgFGPjjqUXPSgoSEQK3i4E75R5IBUM2cRCijauaIHoPhAZkWp yHg53P2qv/aUPPB0N9nxE+eN5rzz6bTWh9ALwNv0BT+Nfp0PQpvHNNwpatNZGe7BW8 zNhBZIJmy8s+Xv+7BST3Rhpl741p/KJVQQv86YaOc3s/XLKCNN01vX9XXYKy3dyuNw WUuIlEzYs/G+Q4w69mQhFywNP06/8BReHA0bNimDqyhekdBpuv9N+RtEZmLP3qyPaI lpo65Hfvl9tBg== Subject: [PATCH v2 6/6] svcrdma: Clean up locking From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Chuck Lever , tom@talpey.com Date: Tue, 21 Nov 2023 11:40:46 -0500 Message-ID: <170058484626.4504.11730967527703634448.stgit@bazille.1015granger.net> In-Reply-To: <170058462629.4504.17663192195815644972.stgit@bazille.1015granger.net> References: <170058462629.4504.17663192195815644972.stgit@bazille.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Chuck Lever There's no need to protect llist_entry() with a spin lock. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 22c39ba923d2..09f5d0570bc9 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -201,10 +201,11 @@ struct svc_rdma_send_ctxt *svc_rdma_send_ctxt_get(struct svcxprt_rdma *rdma) spin_lock(&rdma->sc_send_lock); node = llist_del_first(&rdma->sc_send_ctxts); + spin_unlock(&rdma->sc_send_lock); if (!node) goto out_empty; + ctxt = llist_entry(node, struct svc_rdma_send_ctxt, sc_node); - spin_unlock(&rdma->sc_send_lock); out: rpcrdma_set_xdrlen(&ctxt->sc_hdrbuf, 0); @@ -217,7 +218,6 @@ struct svc_rdma_send_ctxt *svc_rdma_send_ctxt_get(struct svcxprt_rdma *rdma) return ctxt; out_empty: - spin_unlock(&rdma->sc_send_lock); ctxt = svc_rdma_send_ctxt_alloc(rdma); if (!ctxt) return NULL;