Performance: the client and game core masks, from Bannerlator's Linux session

A Steam session runs two things that want different cores at the same time,
and one affinity cannot serve both (Bannerlator cfca3912).

The client is the case that prompted it: Steam pins its own interface renderer
to a subset of cores it chooses - five of eight on one device, leaving out both
little cores and the fastest one - reasonable while a game is running and wrong
when the client is all there is, where it shows as Big Picture feeling sluggish.
BL_CLIENT_CPUS overrides it, re-applied on a beat by the session script because
steamwebhelper spawns children continuously and each inherits Steam's choice.
That block is Bannerlator's, verbatim. One deliberate difference: the client's
mask is sent whenever the override is on, even when it names every core,
because undoing Steam's pin is the whole point and the scheduler's default is
exactly what that pin takes away.

A game gets BL_GAME_CPUS instead, consumed by the Proton wrappers that r27
already carries, and as in Bannerlator it is sent only when it is a real
restriction: a list naming every core is what the scheduler does unaided.

Both live behind a Performance dialog with a checkbox per core, labelled with
its ceiling, and apply at the next session start.
This commit is contained in:
The412Banner committed 2026-09-21 10:49:34 -04:00
1 parent fbe3737dc4
commit beab4e7849
8 files changed
+242

No files matched your search

@@ -186,6 +186,23 @@ case $mode in
done < "$HOME/.bl-steam-urls"
rm -f "$HOME/.bl-steam-urls"
fi
# Cores for the client itself. Steam pins its own interface renderer to a subset - on the
# device it took 5 of 8, leaving out both little cores and the fastest one - which is a
# reasonable thing to do while a game is running and the wrong thing when the client is all
# there is. BL_CLIENT_CPUS overrides it. Re-applied on a beat because steamwebhelper spawns
# children continuously and each one inherits Steam's choice, not ours.
if [ -n "${BL_CLIENT_CPUS:-}" ]; then
step "client cores: $BL_CLIENT_CPUS"
(
for _ in $(seq 1 720); do
for _p in $(pgrep -f 'steamwebhelper|steamrtarm64/steam|gamescope' 2>/dev/null); do
taskset -cp "$BL_CLIENT_CPUS" "$_p" >/dev/null 2>&1 || true
done
sleep 5
done
) &
fi
step "registering the app's game library with Steam"
bannerlator-steam-library "$steam_root" || true
step "setting up the ARM64 Proton compatibility tool"