From af54c0a512171301472c301452d1ae2129e24e38 Mon Sep 17 00:00:00 2001 From: patatahooligan Date: Wed, 3 Jan 2024 03:22:23 +0200 Subject: [PATCH] Fix hybrid CPU core pinning 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. --- daemon/gamemode-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/gamemode-cpu.c b/daemon/gamemode-cpu.c index 39e0ba8b..f27b2540 100644 --- a/daemon/gamemode-cpu.c +++ b/daemon/gamemode-cpu.c @@ -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); } }