[Devel] [PATCH vz10 2/2] sched: Support nr_cpus in cgroup2 as well

Dmitry Sepp dmitry.sepp at virtuozzo.com
Mon Mar 16 18:17:29 MSK 2026


Make the control available for the cgroup2 hierarchy as well.

https://virtuozzo.atlassian.net/browse/VSTOR-124385

Signed-off-by: Dmitry Sepp <dmitry.sepp at virtuozzo.com>
---
 kernel/sched/core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f66ee9d07387..3b13fd3a3f7a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -10431,6 +10431,13 @@ static struct cftype cpu_files[] = {
 		.seq_show = cpu_uclamp_max_show,
 		.write = cpu_uclamp_max_write,
 	},
+#endif
+#ifdef CONFIG_CFS_CPULIMIT
+	{
+		.name = "nr_cpus",
+		.read_u64 = nr_cpus_read_u64,
+		.write_u64 = nr_cpus_write_u64,
+	},
 #endif
 	{
 		.name = "proc.stat",
-- 
2.47.1



More information about the Devel mailing list