Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1520015pxp; Sun, 6 Mar 2022 17:56:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxr3V4Uxg444Gyjs12yt0Ifs6NXcuR+uGwByvQBJ60wIOz2Ybs5tkH+8UCCiwST/lPxFvgr X-Received: by 2002:a17:90b:3b46:b0:1bf:b1f:588f with SMTP id ot6-20020a17090b3b4600b001bf0b1f588fmr10515805pjb.182.1646618212127; Sun, 06 Mar 2022 17:56:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646618212; cv=none; d=google.com; s=arc-20160816; b=of2NFjHR53GSGfcaIr4xjXskgomvlYi4jLL3lyIUohB6AqXBqP/hVhuHleFDFiIoDU Ex4tL1+ok83bAasrmlCRjQ6PrtOxygR6lyOa3jkmsvOhDEeCjS/cXlmBzWzEnRJR8bPG yeyNBqE/gfeJetH9vQJpBaYEFn04mueQ09xP3GgJxBtBFvLjt9ye/zcrrRkwh9/mQRTr fvahl8ayk58EXqFTHKbXhrRMGCnhyGed1rUu1ojCSc6BnImg7xjFYm7rIyO3g0E7APBi GvYrRXTKmjdceCXi0UMiEGiRTEHmi2ZTtFGcL2UNJytnBcS2f/eLCZSRne1TYHFS3of0 SYtw== 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:cc:to:from :subject:dkim-signature:dkim-signature; bh=i04aAdU5/k6G66b0dL8F9Od5zxwdOZ/UHounogEVi8c=; b=oaEza5J6BhDvzZnqgHB2LoeUyAPMPcyBaIip6GCs1DcANBZaGzcLAZhfysBrvlmG7O VwwpEBhsGJuLj0b4JfoWhPxDoRaxlKrHq4qLBtZn4FraIPm5H0gPEtcT5IAsJ8CpaNJU 0j5TpsaiGGhUltRnqnjIibBzDELYRYKqXg6n9E8WZZYMkkMDC89zP4nuHmK7NK0lbBc2 VEROByMva54c2baq3UEsOiU3J5jEv5ysakelAdsCv3PLJQt/gSnQ8JTbJtDF6DHhRGw7 SSsa/XdpnEYZffuHhMzcTJfYQ3JIY2RuOtOFM84dtqeQZSHGJMw0LY/Xyq0L0a8zQX9v epvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Ow915jaT; 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 b84-20020a621b57000000b004e12043af1esi9799689pfb.62.2022.03.06.17.56.31; Sun, 06 Mar 2022 17:56:52 -0800 (PST) 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=Ow915jaT; 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 S234457AbiCFXns (ORCPT + 99 others); Sun, 6 Mar 2022 18:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234455AbiCFXns (ORCPT ); Sun, 6 Mar 2022 18:43:48 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5190D3CFFC for ; Sun, 6 Mar 2022 15:42:55 -0800 (PST) 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 11D49210FC; Sun, 6 Mar 2022 23:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646610174; 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=i04aAdU5/k6G66b0dL8F9Od5zxwdOZ/UHounogEVi8c=; b=Ow915jaTUIFVGccMC7Y/0YsVydtNGcfrbwfjX7mIAG/aZn6DfUqIBgB6fBe56Qig50du/H Y9R43vLa5TOKBdxIKEVEadan1qp8V2+arolrqj4LXIys8aA3T25Ye0Vlb91aLLK9ZjCPug An/Iq+EG8Fy0q07IZLmwv4uM+A28Z4g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646610174; 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=i04aAdU5/k6G66b0dL8F9Od5zxwdOZ/UHounogEVi8c=; b=IuuXTVosi4r+bCwqS2MGldzaT8UuodfL+GTVYQGc1hh3zTc/LMO3C+gYW/IOfuEHoHG2r3 dmTrzmA+u7LuAFAg== 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 EBABE134CD; Sun, 6 Mar 2022 23:42:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7tkiKvxGJWIpWAAAMHmgww (envelope-from ); Sun, 06 Mar 2022 23:42:52 +0000 Subject: [PATCH 05/11] SUNRPC: remove scheduling boost for "SWAPPER" tasks. From: NeilBrown To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Date: Mon, 07 Mar 2022 10:41:44 +1100 Message-ID: <164661010496.31054.6926046073292617693.stgit@noble.brown> In-Reply-To: <164660993703.31054.17075972410545449555.stgit@noble.brown> References: <164660993703.31054.17075972410545449555.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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 --- 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 d5b6e897f5a5..256302bf6557 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 dbffb5147f16..671299542cab 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)