From f8418f6ee907061a7e0c72aeef503f12e003137d Mon Sep 17 00:00:00 2001 From: Liu Song Date: Wed, 29 Mar 2023 11:04:36 +0800 Subject: [PATCH] anolis: Fix compilation error with rich container ANBZ: #4631 The rich container boot cmdline parameter handle rich_container_enable() tries to set __sched_schedstats as well, but that variable won't exist if CONFIG_SCHEDSTATS is not set. This causes a compilation error as: ``` kernel/pid_namespace.o: In function `rich_container_enable': pid_namespace.c:(.init.text+0x13): undefined reference to `__sched_schedstats' make: *** [Makefile:1188: vmlinux] Error 1 ``` Fixes: e777fc6b981e ("anolis: Add a boot command line for rich container") Signed-off-by: Liu Song --- kernel/pid_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 44bcf3843203..d48c6707206d 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -34,7 +34,7 @@ static int __init rich_container_enable(char *str) { sysctl_rich_container_enable = 1; -#ifndef CONFIG_SCHEDSTATS_HOST +#if defined(CONFIG_SCHEDSTATS) && !defined(CONFIG_SCHEDSTATS_HOST) /* If enable the rich container, the schedstats should be enabled. * We can't change the static branch directly of sched_schedstats * because the jump label have been not set up. So we change the -- Gitee