Skip to content

Commit

Permalink
Fix hybrid CPU core pinning
Browse files Browse the repository at this point in the history
Previously the condition would always evaluate to `false`. With the fix
any core with >=95% of `max_freq` will be added to the set of cores to
keep.
  • Loading branch information
patatahooligan authored and afayaz-feral committed Jan 3, 2024
1 parent 4a82094 commit 8cea4c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/gamemode-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int walk_sysfs(char *cpulist, char **buf, size_t *buflen, GameModeCPUInfo
max_freq = freq;
}

if (freq - cutoff >= max_freq)
if (freq + cutoff >= max_freq)
CPU_SET_S((size_t)cpu, CPU_ALLOC_SIZE(info->num_cpu), freq_cores);
}
}
Expand Down

0 comments on commit 8cea4c2

Please sign in to comment.