From patchwork Sat Dec 23 16:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 182979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1751947dyi; Sat, 23 Dec 2023 08:11:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiHRyZYyQIwroJ51KpNJ029pkPyKefUjDn8oeMuV3vtAv/6+PxV2/uMSq+UdbmNB1JnRD1 X-Received: by 2002:a50:d009:0:b0:554:4c4b:589a with SMTP id j9-20020a50d009000000b005544c4b589amr1710865edf.12.1703347896816; Sat, 23 Dec 2023 08:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703347896; cv=none; d=google.com; s=arc-20160816; b=0hrJOsVzxG/p+sKw4Bws8kE2K4VmjAVDkQSudgLfcHIUFvAYWxjsvv7t08RTHH1H2a tHBxGV9GQv4N5A6QQMoiE+veCKB0Sf5ZEeJDfqMK3+IdJN6GfFMsaWQol3HQqUN6tZIU 0fYDiieomixnhuuvZuO+ovBr2DoxlQgq7UEySmWB3Ugp4XA/T1BINtYgTamm7qN3oDdo 2EDy6iYyjKiXeHn0bPJPaCBMbDOr/lGoHhyeA8Am1o/RqsVdvviqcbZnES27lpXw3Zgb lK033nPOFDaL+D/lwACaDB6m/ktI2KntbDYNINUd0dRuJv/1wbwiRsu+25sCYwepAWQu XfYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=nbEZ1iVGY75WmscmXb7jsncGYd8lmWYfGGMLg7Bnu0U=; fh=YUtjNRVYGN89Q+Xlghb77y5lyTSwhbIbnCSvV+Sou+I=; b=KdE12Dl3KqHuGSmKB3YPOOwLcmNvqCS7uWGlUGQm/dBqsfpy+Hre6gVM4BSJ4/z93x X3YmbwGydN/Xkh8pkM3+8CU/Cs1y1mBENd9v5WgD77HZRArlFe28Hb/tb1EsbbkmsJ42 I6fDFujnhpl1Kzg8UckUnk2qIk8tUQ/3bN3EtJDd9nI4wnchZMDa68zJAzAB6F6tOGQ9 t4tUIw98E21jXzV+8yoYxgDninYe0g1SHBFdZjqr4/4/M5rBlb37YXSBFhjsOFixyX9I mAicMGCzuvLjLHVMZEZz3UKtpjTxu47hBaKYJl+GVTMexGzKIq5K/iCPuGHyjavTnMD5 zJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="J6SQmNo/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel+bounces-10489-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10489-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v1-20020a056402348100b005536465920asi2843580edc.389.2023.12.23.08.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 08:11:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10489-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="J6SQmNo/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel+bounces-10489-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10489-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4A40C1F22415 for ; Sat, 23 Dec 2023 16:11:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 997442231E; Sat, 23 Dec 2023 16:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="J6SQmNo/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PcYiDIOl" X-Original-To: linux-kernel@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FF4310979; Sat, 23 Dec 2023 16:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Sat, 23 Dec 2023 16:09:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703347790; h=from:from:sender:sender:reply-to:reply-to:subject:subject: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=nbEZ1iVGY75WmscmXb7jsncGYd8lmWYfGGMLg7Bnu0U=; b=J6SQmNo/bet+kp4d1PA1yDVvorGaLxTx6aoJAwL4Wh8UnJoY3oB/lREpJAFpkT6sBX1coD BDMHpKRMU0pTGXWDpmXHSQwIjW5dtlGV2G8Fdm6N9fyHTaUkm5iD6kJYC2zFqAMm3+FPKE Yj0nBK6z9n2g2BiSPIW4AC5TgLdLfeALv0qAF7YL7/Jo69gKD51Af+SQ6BrwwWLs152dyz 3+vcRR+awbWsnPU0LYHW2U9OX9nDxSRz2l9bBbNYbVA+dtr+/8zFpsRPrrY5Zn02XQKptj oPaP3komIKFSWBQezMcPena/myDgvv/0wK4um7jdxgdmN7GM5moWLc8BrauVaA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703347790; h=from:from:sender:sender:reply-to:reply-to:subject:subject: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=nbEZ1iVGY75WmscmXb7jsncGYd8lmWYfGGMLg7Bnu0U=; b=PcYiDIOlZpmXSbeWMWRIzk3+07yJCbFBKR0Nf+0gppsbC2ALhEMcvpawG4mOTB3om3zAro nnxGxnJKqouG5UDQ== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Remove SCHED_FEAT(UTIL_EST_FASTUP, true) Cc: Vincent Guittot , Ingo Molnar , Lukasz Luba , Dietmar Eggemann , Hongyan Xia , Tang Yizhou , Yanteng Si , Alex Shi , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231201161652.1241695-2-vincent.guittot@linaro.org> References: <20231201161652.1241695-2-vincent.guittot@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170334779013.398.12671460952572863426.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784096965312489932 X-GMAIL-MSGID: 1786089724196004561 The following commit has been merged into the sched/core branch of tip: Commit-ID: 7736ae5572eb344c090fbef9621a228e7e3d6276 Gitweb: https://git.kernel.org/tip/7736ae5572eb344c090fbef9621a228e7e3d6276 Author: Vincent Guittot AuthorDate: Fri, 01 Dec 2023 17:16:51 +01:00 Committer: Ingo Molnar CommitterDate: Sat, 23 Dec 2023 15:59:56 +01:00 sched/fair: Remove SCHED_FEAT(UTIL_EST_FASTUP, true) sched_feat(UTIL_EST_FASTUP) has been added to easily disable the feature in order to check for possibly related regressions. After 3 years, it has never been used and no regression has been reported. Let's remove it and make fast increase a permanent behavior. Signed-off-by: Vincent Guittot Signed-off-by: Ingo Molnar Tested-by: Lukasz Luba Reviewed-by: Lukasz Luba Reviewed-by: Dietmar Eggemann Reviewed-by: Hongyan Xia Reviewed-by: Tang Yizhou Reviewed-by: Yanteng Si [for the Chinese translation] Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20231201161652.1241695-2-vincent.guittot@linaro.org --- Documentation/scheduler/schedutil.rst | 7 +++---- Documentation/translations/zh_CN/scheduler/schedutil.rst | 7 +++---- kernel/sched/fair.c | 8 +++----- kernel/sched/features.h | 1 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Documentation/scheduler/schedutil.rst b/Documentation/scheduler/schedutil.rst index 32c7d69..803fba8 100644 --- a/Documentation/scheduler/schedutil.rst +++ b/Documentation/scheduler/schedutil.rst @@ -90,8 +90,8 @@ For more detail see: - Documentation/scheduler/sched-capacity.rst:"1. CPU Capacity + 2. Task utilization" -UTIL_EST / UTIL_EST_FASTUP -========================== +UTIL_EST +======== Because periodic tasks have their averages decayed while they sleep, even though when running their expected utilization will be the same, they suffer a @@ -99,8 +99,7 @@ though when running their expected utilization will be the same, they suffer a To alleviate this (a default enabled option) UTIL_EST drives an Infinite Impulse Response (IIR) EWMA with the 'running' value on dequeue -- when it is -highest. A further default enabled option UTIL_EST_FASTUP modifies the IIR -filter to instantly increase and only decay on decrease. +highest. UTIL_EST filters to instantly increase and only decay on decrease. A further runqueue wide sum (of runnable tasks) is maintained of: diff --git a/Documentation/translations/zh_CN/scheduler/schedutil.rst b/Documentation/translations/zh_CN/scheduler/schedutil.rst index d1ea680..7c8d87f 100644 --- a/Documentation/translations/zh_CN/scheduler/schedutil.rst +++ b/Documentation/translations/zh_CN/scheduler/schedutil.rst @@ -89,16 +89,15 @@ r_cpu被定义为当前CPU的最高性能水平与系统中任何其它CPU的最 - Documentation/translations/zh_CN/scheduler/sched-capacity.rst:"1. CPU Capacity + 2. Task utilization" -UTIL_EST / UTIL_EST_FASTUP -========================== +UTIL_EST +======== 由于周期性任务的平均数在睡眠时会衰减,而在运行时其预期利用率会和睡眠前相同, 因此它们在再次运行后会面临(DVFS)的上涨。 为了缓解这个问题,(一个默认使能的编译选项)UTIL_EST驱动一个无限脉冲响应 (Infinite Impulse Response,IIR)的EWMA,“运行”值在出队时是最高的。 -另一个默认使能的编译选项UTIL_EST_FASTUP修改了IIR滤波器,使其允许立即增加, -仅在利用率下降时衰减。 +UTIL_EST滤波使其在遇到更高值时立刻增加,而遇到低值时会缓慢衰减。 进一步,运行队列的(可运行任务的)利用率之和由下式计算: diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bcea3d5..e94d65d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4870,11 +4870,9 @@ static inline void util_est_update(struct cfs_rq *cfs_rq, * to smooth utilization decreases. */ ue.enqueued = task_util(p); - if (sched_feat(UTIL_EST_FASTUP)) { - if (ue.ewma < ue.enqueued) { - ue.ewma = ue.enqueued; - goto done; - } + if (ue.ewma < ue.enqueued) { + ue.ewma = ue.enqueued; + goto done; } /* diff --git a/kernel/sched/features.h b/kernel/sched/features.h index a3ddf84..143f55d 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -83,7 +83,6 @@ SCHED_FEAT(WA_BIAS, true) * UtilEstimation. Use estimated CPU utilization. */ SCHED_FEAT(UTIL_EST, true) -SCHED_FEAT(UTIL_EST_FASTUP, true) SCHED_FEAT(LATENCY_WARN, false)