Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp445251rdd; Tue, 9 Jan 2024 08:48:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJZ7zuqTyZHby3K26LR7pIh0qAGJ8IPzT9cBVkBHbGtemXc+ZwUrkjnf9EGnpeBZtT1ydV X-Received: by 2002:a05:6a20:104f:b0:196:a5b5:521c with SMTP id gt15-20020a056a20104f00b00196a5b5521cmr2412711pzc.112.1704818921930; Tue, 09 Jan 2024 08:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704818921; cv=none; d=google.com; s=arc-20160816; b=hm4nNhzU+R3kFruwY+kdOXf5mDTWMdU9FqBMXLSnT4KY2mGQ/TlYrFvj1whrlWd/EC eAtUTlazMtG4uJsMpJy7Nww1z3TDUO/uaQYZajEyPf7Ur4u+PtGpzg9tFlH1j8A57vGv yRPvBqVe8yxTUNBnIc+vXun1ZWaEfzd0uHlIsv78fFt7b95GfvW65Nwc2YVpVOySFtDH 6xQbEBdL4SfUxEEZ376vR+YRjVNyXIAG6nFGRD3EgM5dxZnadxCSR6lfxOBq44XzEdtH cuPzusVEix2sAnIBr7TXfqB0XTiwvORHHnukC0fE5R7ctHKxaK6O5Vlul4Xlx9gVJXGA Ob8w== 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=GUNENfX24A37uKXzgL32igc38T3KBUOtvdr56h+2ocw=; fh=ckb4uIHbQxCINhPspZAm7nYFj+6K7jiYA7oZvU68Qj8=; b=IlkvEQAOO4c7hpzchOC7rNFLmPtcLhcBfxO3yMtCru344Yq622w3nxhH1WENj7BPch AHN7kjlFhRFZVQ9+z6n0rJ0toL+HCEjWYiOknmSkaQKVZXvDEvLoT6rEjGullLfrOdBB Zuf7iipzvcQks8vz9zPX560ZKWfzy1JSyvzJ4hWP6Ue7t0F8u6L2kzrlkKzr7jn9ckWN DuumNW6PbWXiDbJQH6Ot2pwalOnMxn3MI7CS7bvih37DRtbdK5X5L54ONZuHxfaJq99U Zpe5zo0B1enOHlfR3SIAhD4m/00fSmMfK0vkXE6/OhmoK7IjV3GHiFgndRVMJxeRSqgM x4Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L1649ycS; spf=pass (google.com: domain of linux-kernel+bounces-21129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21129-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. [139.178.88.99]) by mx.google.com with ESMTPS id l6-20020a17090a408600b0028b21dd5308si7453941pjg.37.2024.01.09.08.48.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:48:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L1649ycS; spf=pass (google.com: domain of linux-kernel+bounces-21129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21129-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 77A01288B1D for ; Tue, 9 Jan 2024 16:48:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E8D3C08E; Tue, 9 Jan 2024 16:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L1649ycS" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 D281F3BB25 for ; Tue, 9 Jan 2024 16:47:08 +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-f45.google.com with SMTP id ffacd0b85a97d-3375a236525so2823248f8f.0 for ; Tue, 09 Jan 2024 08:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704818827; x=1705423627; 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=GUNENfX24A37uKXzgL32igc38T3KBUOtvdr56h+2ocw=; b=L1649ycSPbxB6I8AZmgZ6W3q2XDcq+nVWRMaNDiPwqpz1fTCbYT2k9kHpGnj2JFhb4 HxSjaIJ2ZnhrOhUDaF0EvAJxKUj92HrhNleSPKCxZu+mlGfDGoACVSyOa2pMXF7vEl7+ LfCl19xeIVZGnmKWKWGIoBDDhHurkLXTvf7jSICz/zJorBkWMmmWW0oAIwtitpPTxTmz PxPaqUvDBr/NvjvZ1Z4XxoS6Kql0433q5u3JYiu5ubjrqGYc0dPrlQiOOAqjTdOqpIZC VGw36ljS5FbeQpVni1wxUTPa91Muqjxls2fiyK3vsaMRWmStHzyw+enumj9UQutAzzgV zoVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704818827; x=1705423627; 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=GUNENfX24A37uKXzgL32igc38T3KBUOtvdr56h+2ocw=; b=mgv9VNDpA228XpfeFF7H09xY/tc8kNekFBMs/eL1F0H/VcaubISIXn0G69ZnBVNntF hcVtTX5DddUn7JE8e6fdsw6GKMbIoC8RZIlyQ19m4yPvar5HW7vw66jlzmdCSmipammi WsSNA+hzJaS1+L6QtTM0OmGZ/DEaKkXzqh88dPLXwugS1DLFESHj4jvPxrS7E8fUl+hO wpEdUmtXiKlbpC9SereMuzS/GMH8FDqNhdaJURV/ZqQGbGKaKyYJAkKc6+fHYVmoKfzP a3y+M0Ioq44ybEn8oLOBK4CnggYC20HuzyNKAnfsg+UpN26jH2G5KQFmfqq0rc6MIOA4 fm4g== X-Gm-Message-State: AOJu0YxFBsoElPeVogf8hhtiQdQeVbeymUD9i4TWxnMjj3LqoMRZp+Xb ViZrxV++95cr6/WZfjt23aca1ZDngfQBRw== X-Received: by 2002:a5d:598c:0:b0:336:8657:60df with SMTP id n12-20020a5d598c000000b00336865760dfmr962148wri.79.1704818827235; Tue, 09 Jan 2024 08:47:07 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:378:51f6:d46e:8457]) by smtp.gmail.com with ESMTPSA id r4-20020adff104000000b00336a0c083easm2847845wro.53.2024.01.09.08.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:47:06 -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 v4 5/5] sched/pelt: Remove shift of thermal clock Date: Tue, 9 Jan 2024 17:46:55 +0100 Message-Id: <20240109164655.626085-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240109164655.626085-1-vincent.guittot@linaro.org> References: <20240109164655.626085-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 sysctl_sched_migration_cost boot parameter as deprecated 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); -- 2.34.1