From patchwork Mon Jan 8 13:48:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13513508 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 3EB0AC3DA6E for ; Mon, 8 Jan 2024 13:49:31 +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=VktE61JbBajbmWJrdVYF+1wDlWD/Kzs6EDn/TATPYZ4=; b=TVniIgIZVvwqgm w/FaXVGe8AglMYr6g0iFGAqzIwLT9P1yq2JYAlMhhSq/2MTHTTeX9fR4Fho6FWsW9X7JATya4oL6q +KlDZIVlvIvaJ46Nqgnxj9SSo9gIWWYbYei6qQCZ4d/frNwWUE6wlBT7+sFmiJ/nnp5YabqLWUwfR vT/cc/3lxzXw89ozswBPmrg0GwlXBoukBFAXC23G+pzWFQyVj0MnrKXA1Lq0BqnOTN6ViTPejCqe7 PejC+kyUYXi0uZVgRnZvj0tpqkZumY3AC5+X1C5ubKoQL4jrUtYiUKfxGTm3+sMS7k83hDQNFv4gt /cF/41S7ci4ZFds7eAbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMpzy-005Fto-37; Mon, 08 Jan 2024 13:49:02 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rMpzw-005FqY-0f for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 13:49:01 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cd56dac1adso9428091fa.2 for ; Mon, 08 Jan 2024 05:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704721727; x=1705326527; 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=3x2TdodL+Fcapt/Lz+/UzPzH9/xPlS0RgAh88kWjJrE=; b=Z9EXUwE5OHni9yvFiixjKn9HVc+30P+FaewocWrrW6F8B5FISLbtl17njs4HwR6JFp j7HDDHrMYjbWuD80a8NksOShXvt8oaUyfH/KW7UgLJUnYndV/a6u2mKCjBc2ZEM5P1Od gc4XdG1M15BBm0fBKWwDlkuGpYJoGJMJ94WOOFz0RilAqVHJ6MYxHOhHvHSfPgtVDnOe aO/pxADwRbjoXgbr858BS7/REY38mLJ2RJqEO4hnkrFWe++cnA6/B1s86aC8gQZQm9/v dINnijnjR4pxUbM0s6ACSVwBpkF0kL+jXsAhnNaRqDxj0Qscg6J5pwhcK4p26akc/C4J 98xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704721727; x=1705326527; 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=3x2TdodL+Fcapt/Lz+/UzPzH9/xPlS0RgAh88kWjJrE=; b=CKXHQ/dN3oTRNtWeSyi5+gCVsWN+E55PiNIiFrsTJoETZeoOPOmrvKqIFC0gnbCbHw Fx4yjj809ZsKvC4VwmlwlMOQI+OCeFU/+8jdximoFAmP/475DEkAPBM33qTFeidtEmS9 y0R+Z9qKeXBowR0b7j8P5slL5+iA6VsAAuHmvV8/qblBAtCbXlTshki0nB+BVXJw0uHU q3dlls3VkUo/Upwr7s7SJ3WLpAqmNLJ1xmueMV8lkmLJytoexo6rk2aWu9DB3UpzxS6L eFNr6bKiZcNl0+vRNyzoVUYahWim3ZM1BuK/cJlwJzjVyDwUj8TI0ItkcvMVEMYb5oIF Sa4A== X-Gm-Message-State: AOJu0Yy7RXXaPGXYTpNyazlDchGV/1ayoNi8KSedErx2jc4rXksOgxBk F2xczYjNRqjz6Mo738Aynblva7R26wtN2A== X-Google-Smtp-Source: AGHT+IF8wvH8PrEkvaQ5eneyPSBxwlk4AX9BIBBL2hHuP2Fx1us01yJftrMyoHDAiZOd2XE/MC7YJA== X-Received: by 2002:a05:6512:318e:b0:50e:7a9e:5c1d with SMTP id i14-20020a056512318e00b0050e7a9e5c1dmr1884615lfe.0.1704721726995; Mon, 08 Jan 2024 05:48:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 05:48:46 -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 0/5] Rework system pressure interface to the scheduler Date: Mon, 8 Jan 2024 14:48:38 +0100 Message-Id: <20240108134843.429769-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-20240108_054900_242088_AC56C274 X-CRM114-Status: GOOD ( 14.15 ) 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/ Change since v1: - Rework cpufreq_update_pressure() Change since v1: - Use struct cpufreq_policy as parameter of cpufreq_update_pressure() - Fix typos and comments - Make sched_thermal_decay_shift boot param as deprecated Vincent Guittot (5): 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 sched/pelt: Remove shift of thermal clock .../admin-guide/kernel-parameters.txt | 1 + arch/arm/include/asm/topology.h | 6 +- arch/arm64/include/asm/topology.h | 6 +- drivers/base/arch_topology.c | 26 ++++---- drivers/cpufreq/cpufreq.c | 36 +++++++++++ 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 | 63 +++++++++---------- kernel/sched/pelt.c | 18 +++--- kernel/sched/pelt.h | 16 ++--- kernel/sched/sched.h | 22 +------ 18 files changed, 144 insertions(+), 119 deletions(-) rename include/trace/events/{thermal_pressure.h => hw_pressure.h} (55%)