Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26951072rwd; Mon, 3 Jul 2023 18:09:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5qIRvht+5H1nPkP9/tCcIeaUlLNy8XhdVWLAgbYQ3yeBYmIZC3AE/r2zFOux0j8MOm01k X-Received: by 2002:a05:6a00:1805:b0:666:b22d:c6e0 with SMTP id y5-20020a056a00180500b00666b22dc6e0mr17991865pfa.11.1688432989460; Mon, 03 Jul 2023 18:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688432989; cv=none; d=google.com; s=arc-20160816; b=0lqw211CE/YOJ5qUU2gTTl4iG26GpbQGWIFLTcn9ZOipfTil+qbm32ipszxEiuxHfR qcTP4a5jQ/1QXM3pSW/4Dn6dOyne5Yc7kS6xP1xwc6oQYTVsZmClTVUj6KB1kY3XyR/b FDrK/NfoJvRAztkCKmU23C6mfHKWl5UVIvx6YMm4OXDatF2NwofWviNV4P2KOZjMR08/ miCFYPmsDUSxi0kpl+wXk/T8D/QpCV5T05F4OSuDIvrexrI3LPhqpwmPT1n/03AwzC1H ValnHDI0ZCHfGvgWk4e/KfpayK1/yQ069EVgHS8oT5+wqCfMQvzne+Yt71YNZB8Gv4f2 UvUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=bIfJqO42Mtbh9ALjJGyZpdB4QlBSMQdQQCq3P+2s49M=; fh=prpaJtz2kvK6JgUs4447rtm1pDQU9vyI1Km5GBTBT9o=; b=ra9sNQr2WkvyxiDb9WaWxmbcXr1ZLvyws4E4hIqSgdINrQLrcE/jP+A/OdhrgWHSSI +h5UeBL+iN34yBaFhV1t1xA/keplUA731/IgvYB2sFcFME637CmurTU2OZbY4WbQvNp8 3iUJ/308a/UjgODkkt5zPiuBsopCJV8Bokhe1/6wwTtRER724tnSlLUS+NOuCcxyd3e/ UKMD7RcPYawNbWHmWkc5o44uWKP1gTUyOoft9TVPzfYqFYq2H+W9s36pgFCa0y4oLtVp 51mVGg/xKUXA7rhtQmIdQ1uB+d203RBPjxf6eLz4jg97YuLKV4BF/34UULUcrm3PDafr x82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lfDI5Uaq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=0JLnginx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a63f508000000b0054fef6280d1si20512327pgh.745.2023.07.03.18.09.28; Mon, 03 Jul 2023 18:09:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lfDI5Uaq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=0JLnginx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbjGDA4R (ORCPT + 99 others); Mon, 3 Jul 2023 20:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjGDA4R (ORCPT ); Mon, 3 Jul 2023 20:56:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D235A136 for ; Mon, 3 Jul 2023 17:56:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 625DA22049; Tue, 4 Jul 2023 00:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688432174; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bIfJqO42Mtbh9ALjJGyZpdB4QlBSMQdQQCq3P+2s49M=; b=lfDI5Uaq3VkymR5XWfzZmkXTz+cc5BdOAau0SkiLhnFrktP92dboBj5W1D9rrcuB05M+Bk mPfeV+liE+j6MmIKHeIbV1R5mALR6F3mvXBScb1XxdJ8ERT0WOIWluPrvxG7sdAnjXX6d4 cSPwXdJ7ONYbDxXG5NB8WzkhMU+0HS0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688432174; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bIfJqO42Mtbh9ALjJGyZpdB4QlBSMQdQQCq3P+2s49M=; b=0JLnginx1jHsmOcbu//uwG0eCz6Z7I2TMeWRvGNUCwQXvPffO8LGblbOBYvZbEmYomccgV ikt08KANRAjFwKDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2F8B013276; Tue, 4 Jul 2023 00:56:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /P23NCtuo2SmcQAAMHmgww (envelope-from ); Tue, 04 Jul 2023 00:56:11 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: linux-nfs@vger.kernel.org, "Chuck Lever" , lorenzo@kernel.org, jlayton@redhat.com, david@fromorbit.com Subject: Re: [PATCH v2 7/9] SUNRPC: Don't disable BH's when taking sp_lock In-reply-to: <168842929557.139194.4420161035549339648.stgit@manet.1015granger.net> References: <168842897573.139194.15893960758088950748.stgit@manet.1015granger.net>, <168842929557.139194.4420161035549339648.stgit@manet.1015granger.net> Date: Tue, 04 Jul 2023 10:56:08 +1000 Message-id: <168843216897.8939.13310930289540832368@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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-nfs@vger.kernel.org On Tue, 04 Jul 2023, Chuck Lever wrote: > From: Chuck Lever >=20 > Consumers of sp_lock now all run in process context. We can avoid > the overhead of disabling bottom halves when taking this lock. "now" suggests that something has recently changed so that sp_lock isn't taken in bh context. What was that change - I don't see it. I think svc_data_ready() is called in bh, and that calls svc_xprt_enqueue() which take sp_lock to add the xprt to ->sp_sockets.=20 Is that not still the case? NeilBrown >=20 > Signed-off-by: Chuck Lever > --- > net/sunrpc/svc_xprt.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c > index ecbccf0d89b9..8ced7591ce07 100644 > --- a/net/sunrpc/svc_xprt.c > +++ b/net/sunrpc/svc_xprt.c > @@ -472,9 +472,9 @@ void svc_xprt_enqueue(struct svc_xprt *xprt) > pool =3D svc_pool_for_cpu(xprt->xpt_server); > =20 > percpu_counter_inc(&pool->sp_sockets_queued); > - spin_lock_bh(&pool->sp_lock); > + spin_lock(&pool->sp_lock); > list_add_tail(&xprt->xpt_ready, &pool->sp_sockets); > - spin_unlock_bh(&pool->sp_lock); > + spin_unlock(&pool->sp_lock); > =20 > rqstp =3D svc_pool_wake_idle_thread(xprt->xpt_server, pool); > if (!rqstp) { > @@ -496,14 +496,14 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_p= ool *pool) > if (list_empty(&pool->sp_sockets)) > goto out; > =20 > - spin_lock_bh(&pool->sp_lock); > + spin_lock(&pool->sp_lock); > if (likely(!list_empty(&pool->sp_sockets))) { > xprt =3D list_first_entry(&pool->sp_sockets, > struct svc_xprt, xpt_ready); > list_del_init(&xprt->xpt_ready); > svc_xprt_get(xprt); > } > - spin_unlock_bh(&pool->sp_lock); > + spin_unlock(&pool->sp_lock); > out: > return xprt; > } > @@ -1116,15 +1116,15 @@ static struct svc_xprt *svc_dequeue_net(struct svc_= serv *serv, struct net *net) > for (i =3D 0; i < serv->sv_nrpools; i++) { > pool =3D &serv->sv_pools[i]; > =20 > - spin_lock_bh(&pool->sp_lock); > + spin_lock(&pool->sp_lock); > list_for_each_entry_safe(xprt, tmp, &pool->sp_sockets, xpt_ready) { > if (xprt->xpt_net !=3D net) > continue; > list_del_init(&xprt->xpt_ready); > - spin_unlock_bh(&pool->sp_lock); > + spin_unlock(&pool->sp_lock); > return xprt; > } > - spin_unlock_bh(&pool->sp_lock); > + spin_unlock(&pool->sp_lock); > } > return NULL; > } >=20 >=20 >=20