Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Build fix on !CONFIG_STACKTRACE[_SUPPORT]

scx_dump_task() uses stack_trace_save_tsk() which is only available when
CONFIG_STACKTRACE. Make CONFIG_SCHED_CLASS_EXT select CONFIG_STACKTRACE if
the support is available and skip capturing stack trace if
!CONFIG_STACKTRACE.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407161844.reewQQrR-lkp@intel.com/
Acked-by: David Vernet <void@manifault.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

+4 -1
+1
kernel/Kconfig.preempt
··· 136 136 config SCHED_CLASS_EXT 137 137 bool "Extensible Scheduling Class" 138 138 depends on BPF_SYSCALL && BPF_JIT && DEBUG_INFO_BTF 139 + select STACKTRACE if STACKTRACE_SUPPORT 139 140 help 140 141 This option enables a new scheduler class sched_ext (SCX), which 141 142 allows scheduling policies to be implemented as BPF programs to
+3 -1
kernel/sched/ext.c
··· 4330 4330 static unsigned long bt[SCX_EXIT_BT_LEN]; 4331 4331 char dsq_id_buf[19] = "(n/a)"; 4332 4332 unsigned long ops_state = atomic_long_read(&p->scx.ops_state); 4333 - unsigned int bt_len; 4333 + unsigned int bt_len = 0; 4334 4334 4335 4335 if (p->scx.dsq) 4336 4336 scnprintf(dsq_id_buf, sizeof(dsq_id_buf), "0x%llx", ··· 4355 4355 ops_dump_exit(); 4356 4356 } 4357 4357 4358 + #ifdef CONFIG_STACKTRACE 4358 4359 bt_len = stack_trace_save_tsk(p, bt, SCX_EXIT_BT_LEN, 1); 4360 + #endif 4359 4361 if (bt_len) { 4360 4362 dump_newline(s); 4361 4363 dump_stack_trace(s, " ", bt, bt_len);