Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp812330pxb; Tue, 12 Apr 2022 14:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS2/1epQ4qh0EmbcoGttgArk2xNznriFCn2jHrOXRTxPpD4T57jFAqOARMf1icziTMCDsw X-Received: by 2002:a63:4459:0:b0:39d:3808:7c84 with SMTP id t25-20020a634459000000b0039d38087c84mr12677915pgk.130.1649797690457; Tue, 12 Apr 2022 14:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649797690; cv=none; d=google.com; s=arc-20160816; b=0/JV6saR00HmDQes9TaijPIQvk6UfcLkWCYCToOYswFHdonl7mFHqJGZba7fPr3G5a qGVJ+TAJdz+MXCZfVw/ZjEI0jk1uQOuIRoFFayn8mHtOTXTfS9khQwkF2ktO3qWjwvxL CYfgkyRBIexCe5ZoK2PMhJQW2hsbH06C4t+7Fjv40UvM5Wj9B6PtgfN4Vz1pNxD1NgzH dUqUPGIrLAAV941H7oiTVD46qQfUMicL51tg6brDZRp2bSRfMLHfyc4A4TFSygnGvMbM 1iDCvqxkvGn505eQ4yO+9vZ6lNB2tOMcVBRIx0VYjKUGHgDk7PG4n2xe3HU0+orCKsHo VaqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KgQn8AUqDVwMQBMVEMXTWCjQMchhI8/XzBO4CEJXkHI=; b=zT15Ay3r12BZgjW4jDKsazPgca9Epg2XtMVYcG3gWyNuehc/7wHmO0yn0p+uc3cy0g +FmCoyJGrP4dyKSfH/pMKR1RmRoPNt5rbaDzk4bCGzWbgrsF6BexuQydQZbFkNju9JAH uZGleMGo/D22CmJcgs9A5ma/lfaruT0jb6jhSNx5pIDqSpRM2wa7Ps7BDB2Dq/E3ZwXF wKklKymEl6Z04zf1lddwfMCM2VRNrCCj7gW8LXLc5Bg71SjL0xawinXtjW3bNCOfMxEs IV+Fgo2WuoxI08ov75gRCm1ro5NJtdNW0nSTgwHbnNE/U2TEALe8FGN81Uv+WYwdkc4h 9Chg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1L3T4F5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oo16-20020a17090b1c9000b001c6efe3d954si18353597pjb.30.2022.04.12.14.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:08:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1L3T4F5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BA5462F8; Tue, 12 Apr 2022 13:25:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382911AbiDLIei (ORCPT + 99 others); Tue, 12 Apr 2022 04:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352545AbiDLHYM (ORCPT ); Tue, 12 Apr 2022 03:24:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68AF74CD41; Tue, 12 Apr 2022 00:00:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AEA55B81B4D; Tue, 12 Apr 2022 06:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A737C385A1; Tue, 12 Apr 2022 06:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649746798; bh=PNElRQwnnCiWitiYMu5FSLHaLbWIvloVo8Zbif/ErFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1L3T4F54jQf+CictMOu3im5kTYoZgvNgkjQmFG6w7k8IQDhdO3vbFBeXTq/OWyao rJ67LmE4XTv/ZsdiPSbXiK1F7Ura7xIwMbjiMXXQIDqh/jexg2YwbFe9B6duZ781WB lojT06Jy7iHr9AIiFkRFSFIWimbm9cyyJjgwp4Og= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Trond Myklebust , Sasha Levin Subject: [PATCH 5.16 134/285] SUNRPC: remove scheduling boost for "SWAPPER" tasks. Date: Tue, 12 Apr 2022 08:29:51 +0200 Message-Id: <20220412062947.534320876@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062943.670770901@linuxfoundation.org> References: <20220412062943.670770901@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org From: NeilBrown [ Upstream commit a80a8461868905823609be97f91776a26befe839 ] Currently, tasks marked as "swapper" tasks get put to the front of non-priority rpc_queues, and are sorted earlier than non-swapper tasks on the transport's ->xmit_queue. This is pointless as currently *all* tasks for a mount that has swap enabled on *any* file are marked as "swapper" tasks. So the net result is that the non-priority rpc_queues are reverse-ordered (LIFO). This scheduling boost is not necessary to avoid deadlocks, and hurts fairness, so remove it. If there were a need to expedite some requests, the tk_priority mechanism is a more appropriate tool. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- net/sunrpc/sched.c | 7 ------- net/sunrpc/xprt.c | 11 ----------- 2 files changed, 18 deletions(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index ae295844ac55..9020cedb7c95 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -186,11 +186,6 @@ static void __rpc_add_wait_queue_priority(struct rpc_wait_queue *queue, /* * Add new request to wait queue. - * - * Swapper tasks always get inserted at the head of the queue. - * This should avoid many nasty memory deadlocks and hopefully - * improve overall performance. - * Everyone else gets appended to the queue to ensure proper FIFO behavior. */ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *task, @@ -199,8 +194,6 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, INIT_LIST_HEAD(&task->u.tk_wait.timer_list); if (RPC_IS_PRIORITY(queue)) __rpc_add_wait_queue_priority(queue, task, queue_priority); - else if (RPC_IS_SWAPPER(task)) - list_add(&task->u.tk_wait.list, &queue->tasks[0]); else list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]); task->tk_waitqueue = queue; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 75acde97d748..b1bb466bbdda 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1354,17 +1354,6 @@ xprt_request_enqueue_transmit(struct rpc_task *task) INIT_LIST_HEAD(&req->rq_xmit2); goto out; } - } else if (RPC_IS_SWAPPER(task)) { - list_for_each_entry(pos, &xprt->xmit_queue, rq_xmit) { - if (pos->rq_cong || pos->rq_bytes_sent) - continue; - if (RPC_IS_SWAPPER(pos->rq_task)) - continue; - /* Note: req is added _before_ pos */ - list_add_tail(&req->rq_xmit, &pos->rq_xmit); - INIT_LIST_HEAD(&req->rq_xmit2); - goto out; - } } else if (!req->rq_seqno) { list_for_each_entry(pos, &xprt->xmit_queue, rq_xmit) { if (pos->rq_task->tk_owner != task->tk_owner) -- 2.35.1