Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4062251rwb; Mon, 31 Jul 2023 00:02:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHj9h+0GtjRY7XK2ptBL586ivZUgCQIlVuLL3egIE8v207aUFGJZIvw7FWKAPOe6cg8rEyZ X-Received: by 2002:a05:6402:14d3:b0:522:b929:9f01 with SMTP id f19-20020a05640214d300b00522b9299f01mr4384302edx.9.1690786969669; Mon, 31 Jul 2023 00:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690786969; cv=none; d=google.com; s=arc-20160816; b=TEwl9UOPnavTkJ5s6beyhRRWdVKwUa+2yTRgpbOf5RUn/OKeYGqRAAOsMdAN5vgFO+ AASUz8fxBGCqvLhQRPwGq5qWwLEfZwzaq+WlTaf7e/xbGWHeBr478OhDReSSWeQKbBTp uRSEVXtPonNRQI5HG3DT6sApGRxdi/sWqBVbxcl+W51c8EUdvzdmwvsKCsqrVj3Kb98/ IdCsCq6gu6LIanuaarLDGq0gdJ4NvBS35bpmE77W5UTih+w6zeVyXcuh7Ex959ih3iiz aQ9TVqvowzFm/8DbkwggN7+jCMp2UqmygOV1GjgJKm7/8D4Q0AZrSW6c8rKiMMD1y7Vi HNRw== 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=K6IzzePqWtX5yZcA/DORS1NIzKLAFlCpyh5Vq2x4UBk=; fh=BG1K0WrNCDl2IiSLnDtgJLHPQBaNsmsTJjqgDAImPg0=; b=zU9hXO50Wcv+Hm1QWANTHyYSB0B0i4DPLD3zwOXtJPCmErnxFzsGSyQ8/c6U5m1/rs eDAeh/+OjgbYvCWTsIWUQJmlXukNcmDw3pckTgLf3N2qksMsG6fn7/aAn20Ut47CUY5R 4y1EtP4EG8QU1pXIpLPWqRqtIAV2hz3mbOtFdwPYTV81Tkq3LE3ztXwvC6lbsN1NF8jW tHGLISp0jhH4WjLQRL/RVey7rziuGem2w6tlqnwsLLyzvR4fIYtZH72a+UA8rH6WIZRs FRi7rfkZ2YlPdgZsWcuE5okBoApUV5XhIYu7VVKwzAfYP6wZro5gA/lMr/YP8mB4r7Yy XH3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=qZ93JHdY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=nuouJCuj; 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 q20-20020aa7da94000000b0052237f1c3b9si3352808eds.300.2023.07.31.00.02.25; Mon, 31 Jul 2023 00:02: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=qZ93JHdY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=nuouJCuj; 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 S230322AbjGaGxe (ORCPT + 99 others); Mon, 31 Jul 2023 02:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbjGaGxD (ORCPT ); Mon, 31 Jul 2023 02:53:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB1C10E0 for ; Sun, 30 Jul 2023 23:52:27 -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-out2.suse.de (Postfix) with ESMTPS id 3F6651F460; Mon, 31 Jul 2023 06:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690786346; 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=K6IzzePqWtX5yZcA/DORS1NIzKLAFlCpyh5Vq2x4UBk=; b=qZ93JHdYYXZlGrZbmhAnciWH7qqCBSPCei1AO4jh2BABdSy6EXpiN4DMN5EA5/bitdZ9Ve 6kE979v6e61CwtaF8N6p3FB47zb0AQqhgfEjaxQHUq4yjttQ6QyzSeDCfiIgLX0QzQNpwZ IRRp2akykh0pAJPmpIjtarOt+5mTH8c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690786346; 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=K6IzzePqWtX5yZcA/DORS1NIzKLAFlCpyh5Vq2x4UBk=; b=nuouJCujZEH7Xiy6TC6lC7aqkAenpG4D6VufdebL7jPQ2jty4i8kpTuVehn4jWByR1Sxu2 kc6TgZgm1SYDpLCA== 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 F3ED81322C; Mon, 31 Jul 2023 06:52:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vDIgKShax2QqcAAAMHmgww (envelope-from ); Mon, 31 Jul 2023 06:52:24 +0000 From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org Subject: [PATCH 12/12] SUNRPC: discard SP_CONGESTED Date: Mon, 31 Jul 2023 16:48:39 +1000 Message-Id: <20230731064839.7729-13-neilb@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230731064839.7729-1-neilb@suse.de> References: <20230731064839.7729-1-neilb@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 - include/trace/events/sunrpc.h | 2 -- net/sunrpc/svc.c | 1 - net/sunrpc/svc_xprt.c | 4 +--- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index c2111bc8a7a1..b100ca16a25f 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -51,7 +51,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/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index d00a1a6b9616..6101c1e38eb0 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -2058,14 +2058,12 @@ TRACE_EVENT(svc_xprt_enqueue, ); TRACE_DEFINE_ENUM(SP_TASK_PENDING); -TRACE_DEFINE_ENUM(SP_CONGESTED); TRACE_DEFINE_ENUM(SP_NEED_VICTIM); TRACE_DEFINE_ENUM(SP_VICTIM_REMAINS); #define show_svc_pool_flags(x) \ __print_flags(x, "|", \ { BIT(SP_TASK_PENDING), "TASK_PENDING" }, \ - { BIT(SP_CONGESTED), "CONGESTED" }, \ { BIT(SP_NEED_VICTIM), "NEED_VICTIM" }, \ { BIT(SP_VICTIM_REMAINS), "VICTIM_REMAINS" }) DECLARE_EVENT_CLASS(svc_pool_scheduler_class, diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 44a614d96d8d..9102cbd3976c 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -724,7 +724,6 @@ void svc_pool_wake_idle_thread(struct svc_serv *serv, struct svc_pool *pool) trace_svc_pool_starved(serv, pool); percpu_counter_inc(&pool->sp_threads_starved); - 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 0ba16cbb998b..f294523595fa 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -736,8 +736,6 @@ static bool 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); @@ -877,7 +875,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