sched/balancing: Remove reliance on 'enum cpu_idle_type' ordering when iterating...
authorShrikanth Hegde <sshegde@linux.ibm.com>
Fri, 8 Mar 2024 10:58:53 +0000 (11:58 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 12 Mar 2024 10:03:40 +0000 (11:03 +0100)
commit02a61f325a8e62a7c76479c5f2f7ddcba16877e8
treea113dd0ab7ec22384bc9df21db1f4c1685d900a9
parent214c1b7f13954559cf09d5d04b934bf32ba4d618
sched/balancing: Remove reliance on 'enum cpu_idle_type' ordering when iterating [CPU_MAX_IDLE_TYPES] arrays in show_schedstat()

show_schedstat() output breaks and doesn't print all entries
if the ordering of the definitions in 'enum cpu_idle_type' is changed,
because show_schedstat() assumes that 'CPU_IDLE' is 0.

Fix it before we change the definition order & values.

[ mingo: Added changelog. ]

Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20240308105901.1096078-3-mingo@kernel.org
kernel/sched/stats.c