sched/debug: Fix 'sched_debug_lock' undeclared error
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I46CWD?from=project-issue CVE: NA ----------------------------------------------- Build error: /builds/linux/kernel/sched/debug.c: In function 'print_cpu_tidy': /builds/linux/kernel/sched/debug.c:812:21: error: 'sched_debug_lock' undeclared (first use in this function); did you mean 'sched_debug_show'? 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~ /builds/linux/include/linux/spinlock.h:241:34: note: in definition of macro 'raw_spin_lock_irqsave' 241 | flags = _raw_spin_lock_irqsave(lock); \ | ^~~~ /builds/linux/kernel/sched/debug.c:812:2: note: in expansion of macro 'spin_lock_irqsave' 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~~ /builds/linux/kernel/sched/debug.c:812:21: note: each undeclared identifier is reported only once for each function it appears in 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~ /builds/linux/include/linux/spinlock.h:241:34: note: in definition of macro 'raw_spin_lock_irqsave' 241 | flags = _raw_spin_lock_irqsave(lock); \ | ^~~~ /builds/linux/kernel/sched/debug.c:812:2: note: in expansion of macro 'spin_lock_irqsave' 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~~ make[3]: *** [/builds/linux/scripts/Makefile.build:303: kernel/sched/debug.o] Error 1 make[3]: Target '__build' not remade because of errors. This is because we backported stable commit "sched/debug: Fix cgroup_path[] serialization", and that commit move the sched_debug_lock into #ifdef CONFIG_CGROUP_SCHED .. #endif, which will raise compile error when we set CONFIG_CGROUP_SCHED to n. The purpose of sched_debug_lock is to serialize the use of the global cgroup_path[] buffer in print_cpu(). The rests of the printk calls don't need serialization from sched_debug_lock. Fix it by removing the sched_debug_lock in print_cpu_tidy(). Signed-off-by:Hanjun Guo <guohanjun@huawei.com> Reviewed-by:
Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Please register or sign in to comment