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.

tools/sched_ext: scx_flatcg: zero-initialize stats counter array

The local cnts array in read_stats() is not initialized before being
accumulated into per-CPU stats, which may lead to reading garbage
values. Zero it out with memset alongside the existing stats array
initialization.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

David Carlier and committed by
Tejun Heo
11fece49 37a93dd5

+1
+1
tools/sched_ext/scx_flatcg.c
··· 106 106 __u32 idx; 107 107 108 108 memset(stats, 0, sizeof(stats[0]) * FCG_NR_STATS); 109 + memset(cnts, 0, sizeof(cnts)); 109 110 110 111 for (idx = 0; idx < FCG_NR_STATS; idx++) { 111 112 int ret, cpu;