From nobody Tue Dec 16 03:22:02 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 429411A0BED; Wed, 5 Mar 2025 04:13:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741147989; cv=none; b=gG3zlYZRxP5JuA7sIKjbJV7tFZC8tVkfy3XuqrizHspYcpfn8hNOtwQuLII47IBz8TJQkQFlC0/t0dFF4NFn5I6eFCL/aogZoX73z1KyXCUMMaBH1pYE0J1keY+6zC8VV++5dgPT440dayA4b7biFdwUz3+UEiaSC9OMezbA3F4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741147989; c=relaxed/simple; bh=GG/SZGLYIJOwryBChnG1M6utn7gxrLvcU3NJELfUlj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oPIOGVbviw+PoNVjGjPyhvwAoekiqUZNj2rtUuq4MSK4yjKCnzPu3CoLdM6z8w4hxKV8tF4gUPo17YCWn0x1/KNmdGwsId/8I5froRjU/9LPQ+AHp07VmG5nZ21GNePR8Flt7EB7EoPfpyJt73PhP3UQ0qc3L8G5/y4Q5rB23oo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VkO5uIw7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VkO5uIw7" Received: by smtp.kernel.org (Postfix) with ESMTPS id ACA69C4CEE7; Wed, 5 Mar 2025 04:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741147988; bh=GG/SZGLYIJOwryBChnG1M6utn7gxrLvcU3NJELfUlj4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=VkO5uIw7ae1NVXr8S9pkURRPuvprT9UqyLAWw7fM1fOU8qNd1HFATL/lSaLpgrAEk E3mLTQxzsX/d/1tB9EvGPwYk15k8D8yLEBZHhArZyaHalXc2LjVagBAYAy6BHkETen hvkwDvpuMQ+q8h3UTh29Q1sfefXvMq2TaWRRGG87P582kRe8xVLefL28cM9DyuY8Jd 4dy8ZAliy+ntXAScfLYObKI7FDsk4sSQFb/cMCbnMfSZdrSAYj6MxWJlbGAQh8kqW7 zJeWz5uvivZcgXc27dSykQTXz2B88VMcj11LiyCEEjKfoFcHsnvSC/mDZDSGFVoAIK FurPXGEkaVIHg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95F16C282D3; Wed, 5 Mar 2025 04:13:08 +0000 (UTC) From: Shashank Balaji via B4 Relay Date: Wed, 05 Mar 2025 13:12:43 +0900 Subject: [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250305-rt-and-cpu-controller-doc-v1-1-7b6a6f5ff43d@sony.com> References: <20250305-rt-and-cpu-controller-doc-v1-0-7b6a6f5ff43d@sony.com> In-Reply-To: <20250305-rt-and-cpu-controller-doc-v1-0-7b6a6f5ff43d@sony.com> To: Tejun Heo , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Jonathan Corbet Cc: Waiman Long , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Shinya Takumi , Shashank Balaji X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2689; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=/4pX+lji8gdMF5fk81/FrjcxVt66tCgC2wZaTKjforA=; b=owGbwMvMwCV2mPH4Ij++H1mMp9WSGNKPnw++Yi2xcdGkB1eEW7keJWp+K955fdK19u37b2ZkF zdGHKpz7ihlYRDjYpAVU2R5J7PuwkEry6avxxm+wcxhZQIZwsDFKQATiVJgZOgJ6J4Re2LRn01V Uv+SpCwslALOXahLLOroElESzPJ6vZCR4VZ7kMi96EjTksmp9gr/uDSb1z0RNHhZKngo+3xT0/f rbAA= X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=EE1CAED0C13A3982F5C700F6C301C7A24E0EF86A X-Endpoint-Received: by B4 Relay for shashank.mahadasyam@sony.com/default with auth_id=354 X-Original-From: Shashank Balaji Reply-To: shashank.mahadasyam@sony.com From: Shashank Balaji The cgroup v2 cpu controller has a limitation that if CONFIG_RT_GROUP_SCHED is enabled, the cpu controller can be enabled only if all the realtime processes are in the root cgroup. The other controllers have no such restriction. They can be used for the resource control of realtime processes irrespective of whether CONFIG_RT_GROUP_SCHED is enabled or not. Signed-off-by: Shashank Balaji Acked-by: Michal Koutn=C3=BD Acked-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.rst | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index cb1b4e759b7e267c24d7f4f69564c16fb29c4d89..f293a13b42ed69e7c6bf5e974cb= 86e228411af4e 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1076,15 +1076,20 @@ cpufreq governor about the minimum desired frequenc= y which should always be provided by a CPU, as well as the maximum desired frequency, which should = not be exceeded by a CPU. =20 -WARNING: cgroup2 doesn't yet support control of realtime processes. For -a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group -scheduling of realtime processes, the cpu controller can only be enabled -when all RT processes are in the root cgroup. This limitation does -not apply if CONFIG_RT_GROUP_SCHED is disabled. Be aware that system -management software may already have placed RT processes into nonroot -cgroups during the system boot process, and these processes may need -to be moved to the root cgroup before the cpu controller can be enabled -with a CONFIG_RT_GROUP_SCHED enabled kernel. +WARNING: cgroup2 cpu controller doesn't yet fully support the control of +realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED opti= on +enabled for group scheduling of realtime processes, the cpu controller can= only +be enabled when all RT processes are in the root cgroup. Be aware that sys= tem +management software may already have placed RT processes into non-root cgr= oups +during the system boot process, and these processes may need to be moved t= o the +root cgroup before the cpu controller can be enabled with a +CONFIG_RT_GROUP_SCHED enabled kernel. + +With CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and so= me of +the interface files either affect realtime processes or account for them. = See +the following section for details. Only the cpu controller is affected by +CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource cont= rol of +realtime processes irrespective of CONFIG_RT_GROUP_SCHED. =20 =20 CPU Interface Files --=20 2.43.0 From nobody Tue Dec 16 03:22:02 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 429921A23AF; Wed, 5 Mar 2025 04:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741147989; cv=none; b=g2kIwV+Q5pyHqJl+0bB8WdcCKF8/YqmC07oxTv7UsyTW0g1xEX3/FlvCgu/aM6fkLUHfAwnhnR+bVd5ZwcECMifFC4IxXX5ctmk1HiLlkS1pyez3V5TQGYaCTKVbUVjIUE5HJuJZGlzQesARWHTCV+/QNN/u59X2bHl3mtzpFZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741147989; c=relaxed/simple; bh=RBsh/xDj4vd4BAKgWWaorA7r/mUYNpFPasyRXkkSQEg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WiLyGbHa49sOqM6SjM6KTglClI3u6mChQzKdbrZbbYCs90O3nDmtWGBypkN5U5IISAQbsXYFlxkV74Fo+fshvU5ELMk/8G7mf8WRPzcoEoGO/JmDew4utj2BUTe35IFQddRTAzXghhOnmXbYmBtyw4lRWWOgjBMzbgaMyKO9N8U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=COvuuk+S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="COvuuk+S" Received: by smtp.kernel.org (Postfix) with ESMTPS id C129FC4CEEB; Wed, 5 Mar 2025 04:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741147988; bh=RBsh/xDj4vd4BAKgWWaorA7r/mUYNpFPasyRXkkSQEg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=COvuuk+ShgIppQ6Ihy1TUO9D39jQ3ibKNx+bE9FsBoqL980OPhD1D1WTp3pmi4+OZ 3FuFgn7nTTPBiboTaxvRR23TZN5tCxba+H5EGb+CtdO3SiiA5adNfoFFnFX2Xf1EyR JNaLAXP18n3FYPxNj+ozt3hXUKvvPMplWITGYT6qTsQnYu86C0uc+VL2BmReakb4RM F52IkM3dJcpyl354lM5nf/I3muacTjwaXRFJkpt8eLmcOWYAik7cbvdsz7i++6lWPg fn2uId5LhUaMmXQPZjJ1YVcCKdPj2/XufF7Gk5VVdIpFegZC0JQC24XHzdJC882hh6 wDXEY0Y+RdvFA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC62C282DE; Wed, 5 Mar 2025 04:13:08 +0000 (UTC) From: Shashank Balaji via B4 Relay Date: Wed, 05 Mar 2025 13:12:44 +0900 Subject: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250305-rt-and-cpu-controller-doc-v1-2-7b6a6f5ff43d@sony.com> References: <20250305-rt-and-cpu-controller-doc-v1-0-7b6a6f5ff43d@sony.com> In-Reply-To: <20250305-rt-and-cpu-controller-doc-v1-0-7b6a6f5ff43d@sony.com> To: Tejun Heo , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Jonathan Corbet Cc: Waiman Long , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Shinya Takumi , Shashank Balaji X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3070; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=C7JgnbF46KXkV/sLIdJxl+OtmX2NjXxlaJ2fLtetvIs=; b=owGbwMvMwCV2mPH4Ij++H1mMp9WSGNKPnw9e//2RmAhj3o5Du+SOLT0Xfi9vQYeCx84HZxYwC vzvemXwu6OUhUGMi0FWTJHlncy6CwetLJu+Hmf4BjOHlQlkCAMXpwBMxG8VI0NzIlvCn5hrrx4x iPRL7MhbL7J4AZ+BcWTx1e7fikX8J2Yz/A9+WhAhdXtX9QvT+uPMHMKiUusO/G6y/eXmc2Ptv5X Xv7EDAA== X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=EE1CAED0C13A3982F5C700F6C301C7A24E0EF86A X-Endpoint-Received: by B4 Relay for shashank.mahadasyam@sony.com/default with auth_id=354 X-Original-From: Shashank Balaji Reply-To: shashank.mahadasyam@sony.com From: Shashank Balaji If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED disabled setting, cpu.stat and cpu.pressure account for realtime processes, and cpu.uclamp.{min, max} affect realtime processes as well. None of the other interface files are affected by or affect realtime processes. Signed-off-by: Shashank Balaji --- Documentation/admin-guide/cgroup-v2.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index f293a13b42ed69e7c6bf5e974cb86e228411af4e..2c267f42e5fef9c4e2c3530ce73= 330d680b9b2dc 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1095,7 +1095,9 @@ realtime processes irrespective of CONFIG_RT_GROUP_SC= HED. CPU Interface Files ~~~~~~~~~~~~~~~~~~~ =20 -All time durations are in microseconds. +All time durations are in microseconds. Only cpu.stat and cpu.pressure acc= ount +for realtime processes, and only cpu.uclamp.min and cpu.uclamp.max +affect realtime processes. =20 cpu.stat A read-only flat-keyed file. @@ -1115,6 +1117,9 @@ All time durations are in microseconds. - nr_bursts - burst_usec =20 + The runtime of realtime processes is accounted for only by the usage_u= sec, + user_usec, and system_usec fields. + cpu.weight A read-write single value file which exists on non-root cgroups. The default is "100". @@ -1158,8 +1163,9 @@ All time durations are in microseconds. cpu.pressure A read-write nested-keyed file. =20 - Shows pressure stall information for CPU. See - :ref:`Documentation/accounting/psi.rst ` for details. + Shows pressure stall information for CPU, including the contribution of + realtime processes. See :ref:`Documentation/accounting/psi.rst ` + for details. =20 cpu.uclamp.min A read-write single value file which exists on non-root cgroups. @@ -1170,7 +1176,8 @@ All time durations are in microseconds. =20 This interface allows reading and setting minimum utilization clamp values similar to the sched_setattr(2). This minimum utilization - value is used to clamp the task specific minimum utilization clamp. + value is used to clamp the task specific minimum utilization clamp, + including those of realtime processes. =20 The requested minimum utilization (protection) is always capped by the current value for the maximum utilization (limit), i.e. @@ -1185,7 +1192,8 @@ All time durations are in microseconds. =20 This interface allows reading and setting maximum utilization clamp values similar to the sched_setattr(2). This maximum utilization - value is used to clamp the task specific maximum utilization clamp. + value is used to clamp the task specific maximum utilization clamp, + including those of realtime processes. =20 cpu.idle A read-write single value file which exists on non-root cgroups. --=20 2.43.0