Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp600020rwo; Wed, 2 Aug 2023 00:41:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHlOaMdxKVQTsCv3sc1G+us/gJAQ8iivyfd8UC6fN29OEK9iDMx5IpMO2mlQDqICS8QlIe6 X-Received: by 2002:a17:903:41d1:b0:1b8:936f:c346 with SMTP id u17-20020a17090341d100b001b8936fc346mr18334702ple.30.1690962079086; Wed, 02 Aug 2023 00:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690962079; cv=none; d=google.com; s=arc-20160816; b=Y1x6b2tkRnpwNp/cO9o5jZVwgIXV2ZBlz3RoaQmkbRnWy4TjryCw6p/ft/eHBGx3wM +Gffw8jXzk7CXDpa7+0R2z3ZqnBLIdNmypcP2und5ea2b8FZ3J0fXPCdkR8QKhlDeUui zB+XiJL0a+1toX78w3evICCyuE0yvYD1PkvXQov3Y1AlWEXMfABYVZ0jimZKAzJNeujT JLbAfucmEuQ9202wHuQJgpTo6Mnx5OguG5NVA7ftJseij06rYc4fukBCut04FSj953DB dMtejPtPufBkAkiTo9L5rF/ai5jc1MbIpc0DjLEG21y/pSGtUE1G1YEuvL74C2vlzKn7 B9nQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=eALRzuehsOll+BS4UYRRQTXyePlI3qJ+Cd+V3HXsEHY=; fh=BG1K0WrNCDl2IiSLnDtgJLHPQBaNsmsTJjqgDAImPg0=; b=esnEFbOg8RhHeiFOxcTcS8sieOg59Ndr36j+4ScwXHuLfVFjfnhQ3hKmVdHsmgxCDs HhAGtVSX0is9+199R9J1g9JS5+4Bepzb5fvoYOJqkvDj1pREHn3DsxzsCtAFoTS1nv+0 O0Ki+34gqWJZAJZyHPqxiY6xGXDdjTY4dqtP0bf7e7toXBxogPKnXw1lgHEgaEMJGpJA CqcmRPLkl7WKighEehO1tkmSRC6Pywhk7qAUmtW5zDQKC7zkAMJz245d503rKprNC0O8 8CbUVsb4JWtHAtSFSV/KVxN4cSscLXQRinnmkvc5mGELvx3SCf2FzKrtyUNGyEAgiMM4 DQVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=r3l32c4D; dkim=neutral (no key) header.i=@suse.de; 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 i5-20020a170902e48500b001bb97f19c0bsi9968496ple.20.2023.08.02.00.41.06; Wed, 02 Aug 2023 00:41:19 -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=r3l32c4D; dkim=neutral (no key) header.i=@suse.de; 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 S232925AbjHBHgA (ORCPT + 99 others); Wed, 2 Aug 2023 03:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232904AbjHBHf4 (ORCPT ); Wed, 2 Aug 2023 03:35:56 -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 EB2E82102 for ; Wed, 2 Aug 2023 00:35:29 -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 75BDA21B1B; Wed, 2 Aug 2023 07:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690961728; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eALRzuehsOll+BS4UYRRQTXyePlI3qJ+Cd+V3HXsEHY=; b=r3l32c4Dc+lOkaHHZdFKyoCoUNikgezH78rHQJ0MblsTtbTj8Dnp3w+p1sJkQLtE46whG7 oYJ1sjz2gxbVkvN9XjyJKf7TnBrQo838Iat7NXnx1E0dy8lHLDfsHexsgpiztcwUjl4KAu 7pNTbbHFlIk0fNz8WBzLBlBt1L5+M2g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690961728; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eALRzuehsOll+BS4UYRRQTXyePlI3qJ+Cd+V3HXsEHY=; b=t321cLg04xj+dCn6yE554OZwgLPFxcJHeh6jToowVCuzuZTtjGNCE9YqTz+GW1Uo7g+Ldn omelGeUUZ5nVlXBw== 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 3489913909; Wed, 2 Aug 2023 07:35:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YsPmNT4HymQ8JAAAMHmgww (envelope-from ); Wed, 02 Aug 2023 07:35:26 +0000 From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org Subject: [PATCH 6/6] SUNRPC: discard SP_CONGESTED Date: Wed, 2 Aug 2023 17:34:43 +1000 Message-Id: <20230802073443.17965-7-neilb@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230802073443.17965-1-neilb@suse.de> References: <20230802073443.17965-1-neilb@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 We can tell if a pool is congested by checking if the idle list is empty. We don't need a separate flag. Signed-off-by: NeilBrown --- include/linux/sunrpc/svc.h | 1 - net/sunrpc/svc.c | 1 - net/sunrpc/svc_xprt.c | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 8b93af92dd53..5ea76d432015 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -50,7 +50,6 @@ struct svc_pool { /* bits for sp_flags */ enum { SP_TASK_PENDING, /* still work to do even if no xprt is queued */ - SP_CONGESTED, /* all threads are busy, none idle */ SP_NEED_VICTIM, /* One thread needs to agree to exit */ SP_VICTIM_REMAINS, /* One thread needs to actually exit */ }; diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index dce433dea1bd..5df7b4353320 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -718,7 +718,6 @@ void svc_pool_wake_idle_thread(struct svc_pool *pool) } rcu_read_unlock(); - set_bit(SP_CONGESTED, &pool->sp_flags); } EXPORT_SYMBOL_GPL(svc_pool_wake_idle_thread); diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index e44efcc21b63..dd60e5810cdb 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -735,8 +735,6 @@ static void svc_rqst_wait_for_work(struct svc_rqst *rqstp) if (rqst_should_sleep(rqstp)) { set_current_state(TASK_IDLE); - smp_mb__before_atomic(); - clear_bit(SP_CONGESTED, &pool->sp_flags); spin_lock_bh(&pool->sp_lock); list_add(&rqstp->rq_idle, &pool->sp_idle_threads); spin_unlock_bh(&pool->sp_lock); @@ -873,7 +871,7 @@ void svc_recv(struct svc_rqst *rqstp) /* Normally we will wait up to 5 seconds for any required * cache information to be provided. */ - if (test_bit(SP_CONGESTED, &pool->sp_flags)) + if (list_empty(&pool->sp_idle_threads)) rqstp->rq_chandle.thread_wait = 5 * HZ; else rqstp->rq_chandle.thread_wait = 1 * HZ; -- 2.40.1