All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10 02/32] sched/core: guard cpu_cgrp_subsys.depends_on with CONFIG_CGROUP_CPUACCT
@ 2026-08-21 16:36 Konstantin Khorenko
  2026-08-21 16:42 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
  0 siblings, 1 reply; 7+ messages in thread
From: Konstantin Khorenko @ 2026-08-21 16:36 UTC (permalink / raw)


From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

cpuacct_cgrp_id is only declared when CONFIG_CGROUP_CPUACCT is enabled -
SUBSYS(cpuacct) in include/linux/cgroup_subsys.h sits under
IS_ENABLED(CONFIG_CGROUP_CPUACCT) - while the cpu controller itself is
built whenever CONFIG_CGROUP_SCHED is set.  With CONFIG_CGROUP_SCHED=y
and CONFIG_CGROUP_CPUACCT=n the initializer does not compile:

  kernel/sched/core.c: error: 'cpuacct_cgrp_id' undeclared here
                       (not in a function)

There is nothing for the cpu controller to depend on when cpuacct is not
built, so simply drop the dependency in that configuration.

Fixes: 776275586407 ("cgroup: allow cpuacct to be enabled in v2 hierarchy")
Feature: sched: emulate virtual cpus for Containers
https://virtuozzo.atlassian.net/browse/VSTOR-134732
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 kernel/sched/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d5b4d8c97a0c..7d2214749245 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -10441,7 +10441,9 @@ struct cgroup_subsys cpu_cgrp_subsys = {
 	.dfl_cftypes	= cpu_files,
 	.early_init	= true,
 	.threaded	= true,
+#ifdef CONFIG_CGROUP_CPUACCT
 	.depends_on	= 1 << cpuacct_cgrp_id,
+#endif
 };
 
 #endif /* CONFIG_CGROUP_SCHED */
-- 
2.47.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-21 16:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260625220832.2201873-1-eva.kurchatova@virtuozzo.com>
2026-08-20 16:57 ` [Devel] [PATCH RHEL10 COMMIT] sched/loadavg: fix build with CONFIG_CGROUP_SCHED=n Konstantin Khorenko
2026-08-20 16:57 ` [Devel] [PATCH RHEL10 COMMIT] sched/core: guard cpu_cgrp_subsys.depends_on with CONFIG_CGROUP_CPUACCT Konstantin Khorenko
2026-08-20 16:57 ` [Devel] [PATCH RHEL10 COMMIT] sched: move MAX_CPU_RATE out of CONFIG_CFS_CPULIMIT Konstantin Khorenko
2026-08-20 16:57 ` [Devel] [PATCH RHEL10 COMMIT] sched/cpuacct: guard ve_root_tg() with CONFIG_CFS_CPULIMIT Konstantin Khorenko
     [not found] ` <20260625220832.2201873-2-eva.kurchatova@virtuozzo.com>
2026-08-21 14:03   ` [Devel] [PATCH vz10 02/14] mm: fix VZ build errors with CONFIG_MEMCG=n Konstantin Khorenko
2026-08-21 16:48 ` [Devel] [PATCH vz10 01/14] sched: fix VZ build errors with CONFIG_CGROUP_SCHED=n Konstantin Khorenko
2026-08-21 16:36 [Devel] [PATCH vz10 02/32] sched/core: guard cpu_cgrp_subsys.depends_on with CONFIG_CGROUP_CPUACCT Konstantin Khorenko
2026-08-21 16:42 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.