From patchwork Tue Mar 26 09:16:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13603718 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 E6C16CD11DB for ; Tue, 26 Mar 2024 09:17:18 +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=SkaRWwnXT7y7PnGsb1DAr5SbbMAp2fMVON+9bGeANyE=; b=LLQ6//ktAXxW8k RVHpnZk0SXS6uuyjqnM6WaYJqv4UqLjazW+rbLCBORaZC6MOdDs+I7ypQRpLU82ID4N5FfS3vkivE py1Y/NCNtaLuulZaPTKtK7GOZZ38Z9uYxdHYrkm8cBCUd3DeKf5FgDGISFuHpR1WWSsMv5e8+DZfQ Azt4THBL5/0tQkQ3zVGI371zTkzAeuSPOMw1QYVDi/6jG0qUvjftSJrH8NrWkdwumYo4WXo5DRXVI QEUxU5NukRfxJbOEv56wIPdEW1MHXsefw4AelNWLtucAsfB2xiP3dswApaNxRtSMxPII17VdM5PJE Ipq+JzY1869wbNMi3HMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp2vV-00000003ltO-0huh; Tue, 26 Mar 2024 09:17:01 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp2v0-00000003lfG-1shZ for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 09:16:33 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d476d7972aso84505611fa.1 for ; Tue, 26 Mar 2024 02:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711444588; x=1712049388; 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=tEa7sTPJSW6I5rKhiraqApmqO1PEw1EfsKWWuLtpUqA=; b=BdNkDEaGfM9YHETkGO000vPIl0yM0282QcmreJfTfgLRrhCeyyF5OWFrpq5chtmKHr eXy+uKubfAqXV36P+GJ5FRHgDPF8yHpQvSdXuHVXJyWqj2v9ms4+CAxEd2IcnDAGjtwl M0kqMKXqgC8Gb6y0xOpdP2LB1C7AQD3I8P3sLMYrTIxGHN2Nhf1yMVVkrb5ctq3cMvHQ uPsxbnnoAzd+huktFXVngfRW70z6x0DJLri5sKn1UIw0lRIvnVXYh+BqQBsZ8/3mTaYu rjiaLsX7aV0Q2LmTzv7ViYGlDkWmzHQ3i5lD+fHmGssXQWf661ojb/MU6hwFSt1DstAU CFow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711444588; x=1712049388; 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=tEa7sTPJSW6I5rKhiraqApmqO1PEw1EfsKWWuLtpUqA=; b=wLDnctnaP2dXZJ6pEhHGQeneWjhK9bbldU34JBOUiqxUGptbvQZFqrToa1Oe9Rgx6g Reb5S+z+37kwExRQjG6N37NWMyXrquWEergM++SiJXllWvPqwX7WvULLEGg9xhTmacAS gxAJPlIqodgbV823hPpnyJdS8YvBybFNS4C2Z58Vst5MFHNgcqYIt53huF3jRRN8Misi ldVwVF4EEfER0CjEQ5fiayF0q2kN53aEqOgnS4dEEUo+bUn6VmPxs41NioJChKcq+pWX SVpmkekbk5qvxfpelV4luQJoDXQbA7NDuO9dzmtC7YhWISPvw109GdBpZR6vrnh5SeYw emdg== X-Forwarded-Encrypted: i=1; AJvYcCVR5LlkIxq5EuvVWd6KuJpE3YPwzdVkkiU1veLQnjt7a6Fu/Q8EJeON2zwkvJgoutswriDqlv44ZZ2f3Y+vDUpg6VmHOtKeiJi9oSv4kQ3wntlF21Y= X-Gm-Message-State: AOJu0YwYqZDgUia/ODzIFxRGactuyRZe+RRi04Kcsb7VxpskuJ2IwL1X LDRsNiafQ5N9vKhSEVhPlpmgWdaFZix5zNwk923SlI/LARL7QioDlNr2bYbXMpM= X-Google-Smtp-Source: AGHT+IGGf2jXiDAnhlOkuMEI4imxOyrO3PVUvWqnMnUfZ8UI9s9IA++rAw1HPl8cghXzf2aqmiMA6w== X-Received: by 2002:a2e:88d0:0:b0:2d2:206a:2f2a with SMTP id a16-20020a2e88d0000000b002d2206a2f2amr6919353ljk.17.1711444588320; Tue, 26 Mar 2024 02:16:28 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:e6b6:c92e:43ff:71d7]) by smtp.gmail.com with ESMTPSA id m15-20020adffe4f000000b0033e5c54d0d9sm11647606wrs.38.2024.03.26.02.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 02:16:27 -0700 (PDT) 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: Vincent Guittot , Qais Yousef Subject: [PATCH v6 5/5] sched/pelt: Remove shift of thermal clock Date: Tue, 26 Mar 2024 10:16:16 +0100 Message-Id: <20240326091616.3696851-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240326091616.3696851-1-vincent.guittot@linaro.org> References: <20240326091616.3696851-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-20240326_021630_612824_DE21E775 X-CRM114-Status: GOOD ( 15.42 ) 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 sysctl_sched_migration_cost boot parameter as deprecated Signed-off-by: Vincent Guittot Reviewed-by: Qais Yousef Reviewed-by: Lukasz Luba Tested-by: Lukasz Luba --- .../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 bb884c14b2f6..3f390cc5f77e 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5807,6 +5807,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 67a8302c3131..1a914388144a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5680,7 +5680,7 @@ void sched_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 2cdc4c242afe..3ac17b20350a 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); @@ -9371,7 +9365,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 5d73d4612e58..35a05f95af3a 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1543,24 +1543,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);