[Devel] [PATCH RHEL10 COMMIT] ve: select CGROUP_PERF only if PERF_EVENTS

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 21 19:42:09 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.6.vz10
------>
commit d7679f3b4e83befd35cc80b312fc32e90ce6d024
Author: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Date:   Fri Aug 21 18:36:52 2026 +0200

    ve: select CGROUP_PERF only if PERF_EVENTS
    
    CONFIG_CGROUP_PERF depends on CONFIG_PERF_EVENTS, but CONFIG_VE selects
    it unconditionally.  On architectures or configurations without perf
    events - User Mode Linux, for one, which we now want to build for KUnit -
    that produces an unmet direct dependency, and a .config with
    CGROUP_PERF=y all the same:
    
      WARNING: unmet direct dependencies detected for CGROUP_PERF
        Depends on [n]: CGROUPS [=y] && PERF_EVENTS [=n]
        Selected by [y]:
        - VE [=y]
    
    Such a .config does not link.  CONFIG_CGROUP_PERF adds SUBSYS(perf_event)
    to include/linux/cgroup_subsys.h, so cgroup.c builds its subsystem tables
    with references to perf_event_cgrp_subsys and its two static keys - all of
    which live in kernel/events/core.c, built only when CONFIG_PERF_EVENTS is
    set:
    
      ld: kernel/cgroup/cgroup.o:(.data+0x26b0): undefined reference to
          `perf_event_cgrp_subsys'
    
    Make the select conditional; a kernel without perf events has no use for
    the perf controller anyway.
    
    Fixes: ba3113998624 ("Kconfig.openvz: force CGROUP_PERF if compiling VZ Containers code")
    Feature: internal
    https://virtuozzo.atlassian.net/browse/VSTOR-134732
    Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/Kconfig.openvz | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/Kconfig.openvz b/kernel/Kconfig.openvz
index 9164db1f2acc3..9358727c1afad 100644
--- a/kernel/Kconfig.openvz
+++ b/kernel/Kconfig.openvz
@@ -19,7 +19,7 @@ config VE
 	select CGROUPS
 	select CGROUP_DEVICE
 	select CGROUP_FREEZER
-	select CGROUP_PERF
+	select CGROUP_PERF if PERF_EVENTS
 	help
 	  This option adds support of virtual Linux running on the original box
 	  with fully supported virtual network driver, tty subsystem and


More information about the Devel mailing list