From patchwork Mon Jan 8 13:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13513510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46018C3DA6E for ; Mon, 8 Jan 2024 13:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7Dvy/Yi9Mm141TDT4gdRwI33jkBjIkF+yMUx53w7pU4=; b=iN24FEAq2o+LNi V7e8Lw2+vVIKW0SUs7pckcnBtdlAvf6BjB8pyE0Bzak2W0uQJxJiKl5ECuDNS/6Nu3oSQdtM1pSqm RqXibNhX1cOZu2S5sy4LgrbHov9VGXqDw6APnYDyYAcYaIg4OM0QlP7osjoSzHYShN6W4pneQ7UPY VnZA69pqjr0IswI86jkNQHB4tdDmkzwmRtQI2PHQSjXWA3mtFHmgK1Z7Divrm04MWgyQ4OuHrJPrk ZwEEaGvr16wuve3NtjCz8Ag4pCZtpPxprw0y/B5wgg4x09TREwtfClinPq6NWGhkZs+yjGB//NE4P J+tdP+e6LpZ3zcLhXyTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMq07-005FzI-0I; Mon, 08 Jan 2024 13:49:11 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rMq02-005Fs6-32 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 13:49:08 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d41555f9dso21427055e9.2 for ; Mon, 08 Jan 2024 05:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704721736; x=1705326536; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q6tS/zmA8jTmUGQmD7ZGbI7KJfpIZIi+8GuPTUd/kRc=; b=dXI4nLxh3pkd56a36i39595xsww9a8l7bkaB9PfsumGA1j8t2jyW79P48R5nkZ6c2O armf2HC6J/Evlyn3db9/aBkFA6bwMmrlD3tMvRWQKcVUxmV7FV04UDiXg5DQg4ZK36D0 W34L2pEmuC/FFooLe+zKyj+lnbxDQd6PTB9vzD4ocFx3ezylvw47ScWzIJeJa3upwer5 7BL94N/raLNHzQcnOOAE75zrOLzQnL9OMRWtOz/BJm1jIVkERGLGXw/6S+gMm5oI7+bG HA7/IqY+lurWUFDCjBG0Q8ZSUkLSVhDtx0YmaoJp04z35NawmMOYP4+nbk9AfhijN9xc zTHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704721736; x=1705326536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q6tS/zmA8jTmUGQmD7ZGbI7KJfpIZIi+8GuPTUd/kRc=; b=t/dNoW+ms5PlpqsGxzukdyjezIxYq06irP7kcQf5JxlGIf2BeS04pPT+Daql2LIfrj dd5BmTOU50yi++eRoC/NoU+jiD1f6b8KtOB4o8v54IxRZ4kcsRnIqi22xTwl6BVzDqF3 WdCCh5KL7axMt6GQ3qvpHjyCr+gHgqJiF+WjslTTih7AJjR0aELNxGi20LCElXi8bIkf A+/LcJ70RD1ezWckj5ExzL+eoXgiFm7YYPetIkJRjWhDXldZXfr5TZKH5hl5pU4DzhuA morqziHDkTUartFWUapglXAZjcVCIBGfcBF/jIh4hvyGCLmAOSd2R4bDr99x6M3agdCM VwGA== X-Gm-Message-State: AOJu0YyLn5hyGRuoLfGXQF4LEetrTAD8YIiFUPO4PDinE3pGZnJsPenN xSPwOGdabsdwt/XuDRXJWMRVA5fkaWZrnA== X-Google-Smtp-Source: AGHT+IExBXWbVBsi6lW0nbPs92Y11blHgXhSiv0yCc/BePGdHEv57ZAi/RZ/fcIrf0iFuASaoWVAHA== X-Received: by 2002:a05:600c:5403:b0:40e:4b6d:c9fa with SMTP id he3-20020a05600c540300b0040e4b6dc9famr30807wmb.147.1704721736518; Mon, 08 Jan 2024 05:48:56 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:53aa:59bc:34ea:bb2c]) by smtp.gmail.com with ESMTPSA id n34-20020a05600c3ba200b0040d5b984668sm11165003wms.9.2024.01.08.05.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 05:48:55 -0800 (PST) From: Vincent Guittot To: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com, rafael@kernel.org, viresh.kumar@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, lukasz.luba@arm.com, rui.zhang@intel.com, mhiramat@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, corbet@lwn.net, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: qyousef@layalina.io, Vincent Guittot Subject: [PATCH v3 5/5] sched/pelt: Remove shift of thermal clock Date: Mon, 8 Jan 2024 14:48:43 +0100 Message-Id: <20240108134843.429769-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108134843.429769-1-vincent.guittot@linaro.org> References: <20240108134843.429769-1-vincent.guittot@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_054907_000455_C1F4140D X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The optional shift of the clock used by thermal/hw load avg has been introduced to handle case where the signal was not always a high frequency hw signal. Now that cpufreq provides a signal for firmware and SW pressure, we can remove this exception and always keep this PELT signal aligned with other signals. Mark deprecated sched_thermal_decay_shift boot parameter. Signed-off-by: Vincent Guittot --- .../admin-guide/kernel-parameters.txt | 1 + kernel/sched/core.c | 2 +- kernel/sched/fair.c | 10 ++-------- kernel/sched/sched.h | 18 ------------------ 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 65731b060e3f..2ee15522b15d 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5722,6 +5722,7 @@ but is useful for debugging and performance tuning. sched_thermal_decay_shift= + [Deprecated] [KNL, SMP] Set a decay shift for scheduler thermal pressure signal. Thermal pressure signal follows the default decay period of other scheduler pelt diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a6f084bdf1c5..c68e47bfd5ae 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5670,7 +5670,7 @@ void scheduler_tick(void) update_rq_clock(rq); hw_pressure = arch_scale_hw_pressure(cpu_of(rq)); - update_hw_load_avg(rq_clock_hw(rq), rq, hw_pressure); + update_hw_load_avg(rq_clock_task(rq), rq, hw_pressure); curr->sched_class->task_tick(rq, curr, 0); if (sched_feat(LATENCY_WARN)) resched_latency = cpu_resched_latency(rq); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f1c3d600d6d6..d5ba6cdb141c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -78,15 +78,9 @@ static unsigned int normalized_sysctl_sched_base_slice = 750000ULL; const_debug unsigned int sysctl_sched_migration_cost = 500000UL; -int sched_hw_decay_shift; static int __init setup_sched_thermal_decay_shift(char *str) { - int _shift = 0; - - if (kstrtoint(str, 0, &_shift)) - pr_warn("Unable to set scheduler thermal pressure decay shift parameter\n"); - - sched_hw_decay_shift = clamp(_shift, 0, 10); + pr_warn("Ignoring the deprecated sched_thermal_decay_shift= option\n"); return 1; } __setup("sched_thermal_decay_shift=", setup_sched_thermal_decay_shift); @@ -9247,7 +9241,7 @@ static bool __update_blocked_others(struct rq *rq, bool *done) decayed = update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) | update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) | - update_hw_load_avg(rq_clock_hw(rq), rq, hw_pressure) | + update_hw_load_avg(now, rq, hw_pressure) | update_irq_load_avg(rq, 0); if (others_have_blocked(rq)) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 677d24202eec..6fc6718a1060 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1520,24 +1520,6 @@ static inline u64 rq_clock_task(struct rq *rq) return rq->clock_task; } -/** - * By default the decay is the default pelt decay period. - * The decay shift can change the decay period in - * multiples of 32. - * Decay shift Decay period(ms) - * 0 32 - * 1 64 - * 2 128 - * 3 256 - * 4 512 - */ -extern int sched_hw_decay_shift; - -static inline u64 rq_clock_hw(struct rq *rq) -{ - return rq_clock_task(rq) >> sched_hw_decay_shift; -} - static inline void rq_clock_skip_update(struct rq *rq) { lockdep_assert_rq_held(rq);