From patchwork Tue Dec 12 14:27:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13489334 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 663A3C4332F for ; Tue, 12 Dec 2023 14:28:10 +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: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:In-Reply-To:References: List-Owner; bh=fEfMiUphkCGYu041kfYrKmzeBKx0pMWNkjINrHeuJfo=; b=LLCsFe5+qJ2mvJ tK79SQct/LdmxYS/0oHYfYPSSyXpU2GfKwYXFjbIVPA+F/U/u9ikzGELw874JylJ0G9dCgp2xotWs QvfhqoT4X8RGvcA+76WwWALoJetSeIPdZ9OA/33joBL3o9eQseCZI7JSciD+UJlv9A57w0svUC0QM 4P3wRiEK/cHv06X/+pkh6f+6AgB4cgaJAbd+ETYS/4wWgy+YQiZt0bElHIbLI/NdQhv+dCMIXjyVI /s+Ef01jxvnf1iTqSWGC55UXV4ARzCDtrhWRetemjqiqNvz73Vs1W7TQ6qZxyLoG1SP7sYG084BSq 8fFD3YdtTSk7r+acl4BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rD3jb-00Bu08-2P; Tue, 12 Dec 2023 14:27:43 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rD3jZ-00Bty1-0G for linux-arm-kernel@lists.infradead.org; Tue, 12 Dec 2023 14:27:42 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50bf69afa99so7349249e87.3 for ; Tue, 12 Dec 2023 06:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702391256; x=1702996056; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oi89GvlAHEHZg03UHqAC2QcBZtFXzQljGaUkYEpdYRQ=; b=sXkMdcckGKg2Rf0EcPxSKKU0OXOdwlrVmn7hG5NFhi7KkQ9R7iKaUgqAny+423XxmV DcINKBej0hlU44arlJy/LzM2fABDgYHnHN5osLo2Deb/3EsQ9/5Zhfsg00UDWeGfV7wK FsSuaNedTZMCk3nXj+iy8yMYzFunIMVcNbyhBD3ZRWL8fZy5Q6WiHKoY5pV2dryt5GWk 6/5/3VaF0DnkUJEdw2s8ydGXeBa8nRvJ5yQd+fmtweleq+P3cLzUWvg8zSRdEeGTVrxM sL5CFOdrIE9iCyvwkiSiTc9V1NDljJldT2T1nNqQJrH2dmDf+UKPpyxFmXeX4WD/vCNc dyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702391256; x=1702996056; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oi89GvlAHEHZg03UHqAC2QcBZtFXzQljGaUkYEpdYRQ=; b=u6Dh/U7Xg6iabTZ2OM+oXO7pE+uVJNTfzZKaZEVz6Z4QCKlguHEGCaYzJQtt+/MM1N OfuTnwMRw4lN8N2n97pE54drIgHeFn0J5Eg/TihgU6Fv2qnhbs9ErImWJHKLG+wcihnY MY1yvzJXOgxU2l3cfRpOJ9/oxcgoWI7962zE999Nk0fla7eqIJa7kMsq1kIuEmPnUEi5 QLiIL1DqAwCu5r5XIJj6M5yN20gbZqnG5QpTBhZ9XshWNbZoUTyZJ/gd8SGwy9Te3+Ut IpRZ/RyNkrSggQcNGIBYTbE1cUZe0l6DHoerd9Vh4gvsebS8Zagmqr/CA8SzhWNUjK1q iTJQ== X-Gm-Message-State: AOJu0YwDinwOiz5ZczTOs/KkFtBWdzI0n7BSmSOxzOqZhKNDTDfMcLJm LOvFr79apVkgCKPRv9k3tIYCDw== X-Google-Smtp-Source: AGHT+IHyo1axms+ckhodl2KbZ/1My7NcqxxzmO0EEcz3ZK+X3IOJxW78U3l56AhQYBvpEUAbefnwcQ== X-Received: by 2002:a05:6512:a8c:b0:50b:f84b:9b0f with SMTP id m12-20020a0565120a8c00b0050bf84b9b0fmr4113837lfu.25.1702391256066; Tue, 12 Dec 2023 06:27:36 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:a004:6e24:43ee:dd81]) by smtp.gmail.com with ESMTPSA id fc7-20020a05600c524700b0040c44cb251dsm9078291wmb.46.2023.12.12.06.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:27:35 -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-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 0/5] Rework system pressure interface to the scheduler Date: Tue, 12 Dec 2023 15:27:26 +0100 Message-Id: <20231212142730.998913-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_062741_125706_55E0B9B1 X-CRM114-Status: GOOD ( 13.18 ) 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 Following the consolidation and cleanup of CPU capacity in [1], this serie reworks how the scheduler gets the pressures on CPUs. We need to take into account all pressures applied by cpufreq on the compute capacity of a CPU for dozens of ms or more and not only cpufreq cooling device or HW mitigiations. we split the pressure applied on CPU's capacity in 2 parts: - one from cpufreq and freq_qos - one from HW high freq mitigiation. The next step will be to add a dedicated interface for long standing capping of the CPU capacity (i.e. for seconds or more) like the scaling_max_freq of cpufreq sysfs. The latter is already taken into account by this serie but as a temporary pressure which is not always the best choice when we know that it will happen for seconds or more. [1] https://lore.kernel.org/lkml/20231211104855.558096-1-vincent.guittot@linaro.org/ Vincent Guittot (4): cpufreq: Add a cpufreq pressure feedback for the scheduler sched: Take cpufreq feedback into account thermal/cpufreq: Remove arch_update_thermal_pressure() sched: Rename arch_update_thermal_pressure into arch_update_hw_pressure arch/arm/include/asm/topology.h | 6 +-- arch/arm64/include/asm/topology.h | 6 +-- drivers/base/arch_topology.c | 26 ++++----- drivers/cpufreq/cpufreq.c | 48 +++++++++++++++++ drivers/cpufreq/qcom-cpufreq-hw.c | 4 +- drivers/thermal/cpufreq_cooling.c | 3 -- include/linux/arch_topology.h | 8 +-- include/linux/cpufreq.h | 10 ++++ include/linux/sched/topology.h | 8 +-- .../{thermal_pressure.h => hw_pressure.h} | 14 ++--- include/trace/events/sched.h | 2 +- init/Kconfig | 12 ++--- kernel/sched/core.c | 8 +-- kernel/sched/fair.c | 53 ++++++++++--------- kernel/sched/pelt.c | 18 +++---- kernel/sched/pelt.h | 16 +++--- kernel/sched/sched.h | 4 +- 17 files changed, 152 insertions(+), 94 deletions(-) rename include/trace/events/{thermal_pressure.h => hw_pressure.h} (55%)