Skip to content

Conversation

bboymimi
Copy link

This is an index typo in test_cpu_stickable(). When storing the alternate domain ID for non-matching CPUs, the code incorrectly uses ctx->i_m instead of ctx->i_nm:

ctx->cpdoms_not_match[ctx->i_m] = cpuc->cpdom_alt_id; // Typo
ctx->cpus_not_match[ctx->i_nm] = cpu;

This typo may cause array desynchronization and overwritten data. While find_sticky_cpu_and_cpdom() relies on these arrays to finalize optimal sticky domains for tasks, the bug could lead to wrong sticky domain decisions.

Fixes: e064ecf ("scx_lavd: Make the idle CPU selection compute domain aware.")

This is an index typo in test_cpu_stickable(). When storing the
alternate domain ID for non-matching CPUs, the code incorrectly uses
ctx->i_m instead of ctx->i_nm:

ctx->cpdoms_not_match[ctx->i_m] = cpuc->cpdom_alt_id; // Typo
ctx->cpus_not_match[ctx->i_nm] = cpu;

This typo may cause array desynchronization and overwritten data. While
find_sticky_cpu_and_cpdom() relies on these arrays to finalize optimal
sticky domains for tasks, the bug could lead to wrong sticky domain
decisions.

Fixes: e064ecf ("scx_lavd: Make the idle CPU selection compute domain aware.")
Signed-off-by: Gavin Guo <gavinguo@igalia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants