Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26987282rwd; Mon, 3 Jul 2023 18:51:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MAYc80TtC3CyQ7/5G3SDi2NXSSLElT/sL/+3YoMEUggiIeT6dEp3iD8isBybzDNlhiaRz X-Received: by 2002:a05:620a:2485:b0:767:2471:c860 with SMTP id i5-20020a05620a248500b007672471c860mr15795068qkn.58.1688435473390; Mon, 03 Jul 2023 18:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688435473; cv=none; d=google.com; s=arc-20160816; b=GONyzX8oPSLCz41qG4Jk878W1CALDIf59LYTHj1TDdGQbq9m/b48ZnB0ZJ0LV2mdxw EMx/En29XldH1PJZScWPCi86zmU4f8WJR+ppoPxNmI0GU2WeiecBGY17x85VS9g/GcRp VKNzouoBUStC83B1Yli+hWNdxysW8bES9K0iFQzzAZqz14lUcOmCQ6tYQ/U/mITryg4L brYT0ZAX7eMx7ZGfuYNer1kqlFf7PKFMCPHJP/cThdJntQgx4li5SDU8HkPURBcBMIa1 4HZvdHQdtn0Xx7pniyzr2Nb8AE1XnxAV2KfUpOQKk3tiePb8c8lPuFdrLtJdFhn/qYCg PD+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yCvXGHoMKR4iODz+GDa7IUxjO6baBCDwjkM/yiFVrg4=; fh=0zUbo2ONdslUw7f7AO+5f/QBKtU64BoJsUr3zKH4I38=; b=p2ZTdsS01QGrIwGAGqRoSKdTHHlJhwTQLHd3KhmKnUJd9+omp1Wxb5+w9FIMMQ68Tr y626TBH1+3whGoIqZWBgJnvevQoM3K92LhOKY+Mm3hGl/ZJlYDON4ea7t/uzxMgC90xT 9NSiG4LiG3668jKJjJDnpHjO8XCJnQpkzzhPih2OBYZHKCC8SPZcoFFUfimVcLUUCNf0 5CbzyIDMHc7QJ7pzrANBjfusM1jzikNRuTqj3jZA2h0q7IXefnWdaxL9cQqn3sMlDt9J TQDfdwxzmrY7ixOFWQTs6LlXnPipsoDEVxNnWro/pQ5qFV/M0jY4Ld4Ql/8ALLympsH8 HFzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="R/IAijya"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cl8-20020a056a0032c800b0067d2eeacacesi13766947pfb.355.2023.07.03.18.50.57; Mon, 03 Jul 2023 18:51:13 -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=@kernel.org header.s=k20201202 header.b="R/IAijya"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbjGDBsm (ORCPT + 99 others); Mon, 3 Jul 2023 21:48:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbjGDBsl (ORCPT ); Mon, 3 Jul 2023 21:48:41 -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 17F86E54 for ; Mon, 3 Jul 2023 18:48:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 876686108E for ; Tue, 4 Jul 2023 01:48:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E5C3C433C8; Tue, 4 Jul 2023 01:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688435295; bh=7J+akZNM+HSYfrHj5U8NXN8J9SWZrdDti9eT/Grsib0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R/IAijyaDehFGto+TqDWO0MCoF3GABzJ6sjIIuoMGEOsB4koR6NcYRPurtWFFSvaH RGszR0OW3BB8Ms9yac8ZOXIJgs2tR3k8DVV2FKjaLhRC+FMTTOBpSwWz6hnsvrb7W4 GZI03Pk4E1WP9RdUkrXUvyWN2UXtclNbC4Q9UlPBqKBXIfMBAvHT6nsdkvmJadFE5Y yWt5qYAmNAlMkYw5OfibzHTSTJanYF3r0u/MiOHIx6rowZDYFr8uaQ3GESpDLrlXr5 k1Fh+bdAEt85+wXg90qxLDfEgjFVx/NTwvto9dygRyDiss89XiRBVHmGJSY3IGzLPL U1/iZMJIXOxlg== Date: Mon, 3 Jul 2023 21:48:12 -0400 From: Chuck Lever To: NeilBrown 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 Message-ID: References: <168842897573.139194.15893960758088950748.stgit@manet.1015granger.net> <168842929557.139194.4420161035549339648.stgit@manet.1015granger.net> <168843216897.8939.13310930289540832368@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <168843216897.8939.13310930289540832368@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, Jul 04, 2023 at 10:56:08AM +1000, NeilBrown wrote: > On Tue, 04 Jul 2023, Chuck Lever wrote: > > From: Chuck Lever > > > > 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. > > Is that not still the case? Darn, I forgot about that one. I'll drop this patch. > NeilBrown > > > > > > Signed-off-by: Chuck Lever > > --- > > net/sunrpc/svc_xprt.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > 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 = svc_pool_for_cpu(xprt->xpt_server); > > > > 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); > > > > rqstp = svc_pool_wake_idle_thread(xprt->xpt_server, pool); > > if (!rqstp) { > > @@ -496,14 +496,14 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_pool *pool) > > if (list_empty(&pool->sp_sockets)) > > goto out; > > > > - spin_lock_bh(&pool->sp_lock); > > + spin_lock(&pool->sp_lock); > > if (likely(!list_empty(&pool->sp_sockets))) { > > xprt = 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 = 0; i < serv->sv_nrpools; i++) { > > pool = &serv->sv_pools[i]; > > > > - 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 != 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; > > } > > > > > > >