Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp444689rdd; Tue, 9 Jan 2024 08:47:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5YCF+8n79Ldz0jm28JV5slmuSlLJzZjfLfXVCMRi26INjchQx3DR27Mqgcio+rPIdzEQf X-Received: by 2002:a05:6358:5242:b0:173:50b:26ed with SMTP id c2-20020a056358524200b00173050b26edmr6731474rwa.36.1704818853101; Tue, 09 Jan 2024 08:47:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704818853; cv=none; d=google.com; s=arc-20160816; b=k5xbVin63b6l4vbUf4qev36osK0lDz9Yh/t8oy8oyo1gHQyE9w5ECUb7JVhd8Im26N iGbzfz5SHS2oTW8MxR5kAZaHM3dxumKnXCUo64Vig91726GVJz6dEE3x3FacdFMz1Fpf M1lj3PEHR2h3CbLOrxUMQk243f8T83D78vxmDEQya+IW/C5jS7OYFfjtaPCEgeaXAb0m s+WK2PeoGPTqObH0wd6GFsyLGhRoE04WWLebZAdciPH/1G98cYyBQ3Shabi+uPO5/3DN 7TrKJY+2CjTq2L3lUtUCJdkz81AXPw8A5JNa/TrI6CEitWF0I0dptb7mn9fcO2foE/L5 W/Gw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=Kyb6CN2MTJ0KrepLWGAugAgymHc/HiwDmVkQZF3Jz+E=; fh=ckb4uIHbQxCINhPspZAm7nYFj+6K7jiYA7oZvU68Qj8=; b=wSBZLuQB24JhKynmoO2HGNkSH5Wg71c1DmG31XQIE9d2y8O7/5DTTYdFLB7cc8gJZZ FVbEO1jhKu/IZdt2dJIKCxiRfby/d51zf4Rv/pwImxJO+2sJAy3znHs4lFAvv2LOn2jh VsRcytS28pNZzKKs3ow9Jm36r4bR75UDFuzXVIquUVXJJkXSYK+Kf9+A5SU1sBoE9pxC ocVOhL1gDxHEoH3kG23/es4oWMwYZcJeWxZyXYD1lLN43rP8op0dvFislALIvz//kKbP bXhJMqNPK58aWrxX5HcJO80bPycp2kWDx2GEgLg5j0FAdtXmbxGc2rMcjtulhO3pXpqn 31LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cp29K+++; spf=pass (google.com: domain of linux-kernel+bounces-21124-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21124-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 u13-20020a056a00098d00b00690dbd360basi1208008pfg.152.2024.01.09.08.47.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:47:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21124-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=cp29K+++; spf=pass (google.com: domain of linux-kernel+bounces-21124-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21124-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 B8D7E288B7E for ; Tue, 9 Jan 2024 16:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B7E738DF8; Tue, 9 Jan 2024 16:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cp29K+++" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 9B8933A1D4 for ; Tue, 9 Jan 2024 16:47:00 +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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40d5aefcc2fso35731025e9.0 for ; Tue, 09 Jan 2024 08:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704818819; x=1705423619; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Kyb6CN2MTJ0KrepLWGAugAgymHc/HiwDmVkQZF3Jz+E=; b=cp29K+++Oy4/Vn7OfXe9ZoO+/1ViLgt5OhQUP915YB0MmAK1WBVPFW6AhCC/L7/nzR 4DrH5uJh49YpE2xJLlBdrdX+8PFYV6jJo8yr2sARo54wbimFqsiEFDBhipe0xKIPu/1r DbNfxo+mk99p4FRTzVnsJPcYZwQcXORK4NNN9Y8gOZpGG3ZaJoM/EOq0PWa+1BrxHpJi E/SeH7Sf6R4Avk/roUWRc2zPNBSjL6IrHBKpwVB+hJdElr0EGFP/eoQJLCXp+KBkp8k9 fyjVoT7bqNIi/ll7WnTFb6hWDiVFaQ6H0GBFdX5WS5FEKstHhA7xn9NdQFlA4GXIKepg mgbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704818819; x=1705423619; 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=Kyb6CN2MTJ0KrepLWGAugAgymHc/HiwDmVkQZF3Jz+E=; b=TQXLRSXX52MgikwRpalfQDOsnQnHwWBNbdIxIB0x5CApaq7nYqHpCsuM1wICoMXKPp odCCOTTuQqHGpwI+7O26gqDt4I2I2vTJAT1/VNor15ZhDbL8CwLe+sXVw2aOSfVESTWx 1Jvagw30Fnv9jObwNTOoX0RpOVapzSSuP8bFy89VnjEeGuR4nspQKLktVY74gSZ/SFRR x+wibWKkr6Qc1bvJ4paleIAqb94UrUDZzclQNMeYdUPPdF8SEETUl2pB5kXqgKIR1gk2 GJG+oacPuoIszk7AQhxB6BfTe7kt7D+dFgJMtNgmyHoQ8ERQDUSyOoBLC07SRb72lCCu 7g/Q== X-Gm-Message-State: AOJu0Yy1z6/TCW+2v/mqlTSGrLOZJPrZ9x5Y3vhHHfhSn1+nef/spWf6 4+mTziGjh3XWbt9qg9bpLD9B0/6DuaZ1TQ== X-Received: by 2002:a05:600c:22d0:b0:40d:8199:c3f with SMTP id 16-20020a05600c22d000b0040d81990c3fmr3183585wmg.153.1704818818906; Tue, 09 Jan 2024 08:46:58 -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.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:46:58 -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 0/5] Rework system pressure interface to the scheduler Date: Tue, 9 Jan 2024 17:46:50 +0100 Message-Id: <20240109164655.626085-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v3: - Fix uninitialized variables in cpufreq_update_pressure() Change since v2: - 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%) -- 2.34.1