From patchwork Thu Dec 21 15:24:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13502270 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 83B27C35274 for ; Thu, 21 Dec 2023 15:24:45 +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=FHJTUew2w6Qy0MzjYtutJq/M2MoimML/T9b7QRyR0mw=; b=WSEzBlHv4F0Yit WeRqNuWLQCJUUfhboV85zxbybCjSg3EObECgBHR1x3f80h9Yycp/63OFaaEKf1+vRilsQIbktOuz+ Snhu540TmEBwb98mQKMmnY+V94hln9N370uCauSPUlboY3BdMMHobMAduHdgyHtBEu4FoBgwFLE+n 09q8T61ISyyJn8bnHb98ETcCdsFm/AGhlnDNE/l1A6zMSL4s/AlgB6D74fq1q0ghMv4smUnV9gL/r B16Hx2b1rj26if5AXprmcZlMgcahIxxlZpWieky79BtN8RTWphsltXTtw5n5t8ijZTj7zP5bCUpih W2R28SmB9oxpE36na+yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGKuH-003JxR-1O; Thu, 21 Dec 2023 15:24:17 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGKuD-003Jt0-2R for linux-arm-kernel@lists.infradead.org; Thu, 21 Dec 2023 15:24:15 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40b5155e154so11258245e9.3 for ; Thu, 21 Dec 2023 07:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703172251; x=1703777051; 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=/XnYWAWl26fljdZ1eq0DEOr8xRmoWq9IceEo0OwSXEM=; b=dwXq23HKq0utPf5suHSdfnqPFDOpdTgccakWvKt4odAeDGERe6T+KoBRx5ZfLdHpNJ vUCajVw7Ua5JG7z4dYUW26ssIYsMOgXw6zl3JRE5XPwBRIhCP/HcRrt24ctsJNl2oAce 8KVXw+VQICI0ReBCZNrXJB57aoxaWR65RV6PbgwvjCsSARlmJg12VZ0HNOdzJCxa7FcA abbdZNyEPWKTDCIUR1zp9q6EInlNb11kekrYMnw1R9ZhqLe5pau3hjgtpzzpmXOhTNVS qgsxCK7ofYJvjsFSxcI22N69ASJ0AdCvpKQ4LVvV5IQXfYYuJnqdwdqmu7rza70QEYXl 5MLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703172251; x=1703777051; 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=/XnYWAWl26fljdZ1eq0DEOr8xRmoWq9IceEo0OwSXEM=; b=H3tP/RJWaNQKDoFDG7Yy397W+sFARgCThE9R9fQIZKnp5TY8uDJZuSMDnalUaTTQMO WbamCtPSf9a3Isd6aPMX4FOJvDeuxdpDSFGq8iimodk8ITrI2wwEatHGulXGWGsm6aml t1Mh/2lxwNeI3hSG+uCRL/Z2wkOHSPsz9EjpZWbAeMJRkleP5nsxPq+jdXRMHarOQyaV tml9PmlabwwJ83bMCsY3hgf2J9YXoxp0QKrI/t8zk3D8iktcwoWNqXga8NgJitz0ecEZ PJLkZvlkTciYQVNy8fBVxXPwmkS1LV3VTptp2v/T9sTpptnyWYHCjxB5fxxlRHoDN2S+ tkKg== X-Gm-Message-State: AOJu0YyY2WFv+joFntap6rV1wML9pjnZ3MS+rwJHH2bgdNo/oN/XI0vW wgDOIE7BnHrpOS29WxwDR8w+MQ== X-Google-Smtp-Source: AGHT+IGHy1A1RTCdL6pRPW1PyWOXhl6RuneTu+2GCu8vndp3F2NPHNxrmP0VXwZLO7mpsjJUq7SHGA== X-Received: by 2002:a1c:7411:0:b0:40d:177e:c024 with SMTP id p17-20020a1c7411000000b0040d177ec024mr840724wmc.187.1703172250872; Thu, 21 Dec 2023 07:24:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:24:10 -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 0/5] Rework system pressure interface to the scheduler Date: Thu, 21 Dec 2023 16:24:02 +0100 Message-Id: <20231221152407.436177-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-20231221_072413_794717_44D795E3 X-CRM114-Status: GOOD ( 14.01 ) 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: - 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 | 34 ++++++++++ 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, 142 insertions(+), 119 deletions(-) rename include/trace/events/{thermal_pressure.h => hw_pressure.h} (55%)