Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp227612rdb; Thu, 21 Dec 2023 07:35:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1Kqs701ssTsZK9oj3fOwg6CIIpGEqiBm6bOH08M+/aG2mN9CwqqpdA7wdi/M1ini3yDj8 X-Received: by 2002:a17:90a:f417:b0:28b:c0a1:15f with SMTP id ch23-20020a17090af41700b0028bc0a1015fmr2145288pjb.42.1703172938519; Thu, 21 Dec 2023 07:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703172938; cv=none; d=google.com; s=arc-20160816; b=0zUVpKCV6cgG74AVrcFQUTCUHxZ+62tQ4yf5mOvTBip8QCXBOHKACXYgQdXYlaekga DI66h2hcBGtgnvIcc4hiHMpJJmnaiaPmsIK3JpVspPuL5yKTxCSdPAv6flpk6XQGtZYd 7EGkV7XtEiuwfoh75kp4WxpPPnroyO5KQ/Aji1VEP8Qld1ZCKYTpN0cpSAXXAf6fhEWW DH2bxFVX2H4rwF6KtJ6/WAverZPVor7lN9v2z0116byzc4TMnv/0nhinILphHOEvxfJB ZOE+KC3Q8WSGry4KOV07FtuiL9Vg7xCsKLgpU4K7U+xb2Whqq2SO9+omr9iiHoSGkfuu YnOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EW4UFXmfryDRvAbEc3thu9hdl9GkSp2IgG/2/oPu1XE=; fh=iADtN8DS7aRpM2ioXQmdV7EpooAyhly8rwPOp18JeP8=; b=B6D8vfIo5w7JvEdpu0VaRBnHYN7S7G0U6+kQ7J1PdXD9+QlqfBWJPkVQovXWUwG4OJ 3wKuqKzqwZEVFtUtjj1diuWkM0KrfDwuatyjPXYdtq6lSh1WpEDP9OUj518O42Oa2Pgf qFV7eDh7GVSf2gd5olofthlDKA4sTQyPQSAXIsMDCgGaUU9p9O9OlLDaenRr2MbDJ5IS derww/TzJIESQRfrOls6sipy7tAHoau4wHTBRYpQSAV5i3/Wm1BLnIrdgZB50kRFnJKk NTeY/LvtY7szFNW4ff5k+DokwThDf4Ooj680vTywqtwGk45lIjXDRaNTXfAn5TZfcx+m 8mFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CFb1oPYU; spf=pass (google.com: domain of linux-kernel+bounces-8651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nk10-20020a17090b194a00b0028bda9780bcsi1832094pjb.3.2023.12.21.07.35.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:35:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CFb1oPYU; spf=pass (google.com: domain of linux-kernel+bounces-8651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2FE6428BEAD for ; Thu, 21 Dec 2023 15:25:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A679758218; Thu, 21 Dec 2023 15:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CFb1oPYU" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37A3958214 for ; Thu, 21 Dec 2023 15:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-3368ae75082so382204f8f.1 for ; Thu, 21 Dec 2023 07:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703172258; x=1703777058; darn=vger.kernel.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=EW4UFXmfryDRvAbEc3thu9hdl9GkSp2IgG/2/oPu1XE=; b=CFb1oPYUVZuKtyxsTQYDiYV7XR5OXVAgJd9Mktt1mqjEsxGfoAnARasGZcvGTEpUAZ TfO5HxearkFBts+C1t1eN+0xu5TAmysCFz/AIm3H7GDkPOvzmOgy0vJGyO14ERtH2HhL 1EgMxuMsGDBFA3EPclCqW9Y1BnsT2Q9lCgNIZlSsjHje6Vz1qEg7Umi9NTAqBbizXnTJ kkTXbcEQdSFbxNsSW4B1AkYaoGhltwQYa5Ll8T3dZ77Yc483TOi1yNAIeWSycHHE5/Zx ntAdq/QKAXi2/Sz6yASwTO7BWt1pGWNjc2OaAne9MkWlQBq46ZEZG8sADaZdXixBtdYS Vffw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703172258; x=1703777058; 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=EW4UFXmfryDRvAbEc3thu9hdl9GkSp2IgG/2/oPu1XE=; b=pfCqxeJStDnVqw5dT9nDBY3rAHrSle54zqGhWROFbolx1tzeoIiye1cqUrbvWn7sTz mKJYWTf10+xKVylAbPhGpWpnZAHmem16snWiY8BRBsZTyZkadqxlQzfOT6T1exXiRQct SWNMq2hMDD+akq7uEVbdoYuEP+0U8jM4Nddn+1mz/n2HF26YexSQFr/RghER0Pfb2o7f pfi/ymRHq33C5UgSXTcG/ny0RJy0/GfGGPbj+3pqe+hcvQfmb98FdDZrm0HXzaBioxTh QTbrgVyd2tS//r3fjKzlCR2sUMs0ma+2eXMsvH7oVC9nQKoVWrWXNQEVKOHCteEJJRgq szRQ== X-Gm-Message-State: AOJu0YywhDGcG29hidiVaG4tk/YEDOTLmQCRzUQH44QyxSBs2wcR9a5F EKhYU2fV1J5qWVgpAQY8d6yTCA== X-Received: by 2002:a05:600c:3b25:b0:40c:6a61:23da with SMTP id m37-20020a05600c3b2500b0040c6a6123damr564633wms.41.1703172258515; Thu, 21 Dec 2023 07:24:18 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:2db4:9d2a:db65:42d6]) by smtp.gmail.com with ESMTPSA id t3-20020a05600c450300b0040c4acaa4bfsm11466974wmo.19.2023.12.21.07.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:24:17 -0800 (PST) From: Vincent Guittot To: 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, linux@armlinux.org.uk, corbet@lwn.net, 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 Cc: Vincent Guittot Subject: [PATCH v2 5/5] sched/pelt: Remove shift of thermal clock Date: Thu, 21 Dec 2023 16:24:07 +0100 Message-Id: <20231221152407.436177-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221152407.436177-1-vincent.guittot@linaro.org> References: <20231221152407.436177-1-vincent.guittot@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 ce0d32f441a8..16d71e764131 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); @@ -9271,7 +9265,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); -- 2.34.1