Re: [PATCH 18/19] sched/fair: Avoid cache-aware scheduling for memory-heavy processes

From: Chen, Yu C

Date: Thu Oct 16 2025 - 00:44:39 EST


On 10/15/2025 2:57 PM, kernel test robot wrote:


Hello,

kernel test robot noticed "UBSAN:array-index-out-of-bounds_in_drivers/base/cacheinfo.c" on:

[snip]

[ 12.549731][ T83] ------------[ cut here ]------------
[ 12.550388][ T83] UBSAN: array-index-out-of-bounds in drivers/base/cacheinfo.c:37:9
[ 12.551060][ T83] index 4294967295 is out of range for type 'unsigned long[8]'
[ 12.551580][ T83] CPU: 0 UID: 0 PID: 83 Comm: systemd-journal Not tainted 6.17.0-rc4-00035-ge8b871200f11 #1 PREEMPTLAZY
[ 12.551585][ T83] Call Trace:
[ 12.551588][ T83] __dump_stack (lib/dump_stack.c:95)
[ 12.551594][ T83] dump_stack_lvl (lib/dump_stack.c:123)
[ 12.551601][ T83] ubsan_epilogue.llvm.16751680356772289369 (lib/dump_stack.c:129 lib/ubsan.c:233)
[ 12.551607][ T83] __ubsan_handle_out_of_bounds (lib/ubsan.c:?)
[ 12.551621][ T83] get_cpu_cacheinfo (drivers/base/cacheinfo.c:?)
[ 12.551625][ T83] exceed_llc_capacity (include/linux/cacheinfo.h:? kernel/sched/fair.c:1256)

Thanks 0day! It seems that for some reason the assignment of curr_cpu = task_cpu(p);
was after the check exceed_llc_capacity(), will fix this.

thanks,
Chenyu