Repository navigation
Conversation
…critical thread priorities (Fixes Revivedx#639)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Fixes #639.
On Windows,
plat_cpu_placement()enabled one logical processor per physical core by default for systems with SMT and 4+ physical cores (plat_one_per_core_default). On heterogeneous/hybrid architectures (Intel 12th/13th/14th Gen, Core Ultra, and AMD hybrid architectures with P-cores and E-cores), this truncated the process affinity mask by masking out the second SMT thread on every P-core while keeping all E-cores intact (e.g. an 8-core / 12-thread i5-12450H had threads 1, 3, 5, 7 disabled, leaving only 4 P-threads and 4 E-threads).Because Savage Wind runs multiple active threads (guest main thread, job workers, audio, file streaming, NVN queue/render thread, Vulkan recorder, present thread, plus graphics driver submission/compiler threads), halving the available P-core execution slots starved the system and forced Windows Thread Director to spill latency-critical threads (the main game thread and render queue) onto low-clock, lower-IPC E-cores. When running on E-cores, frame rate plummeted from 60 FPS down to 40-45 FPS randomly until threads were migrated back.
This change:
plat_cpu_placement()by comparingEfficiencyClassacrossRelationProcessorCorerecords. Whenmin_eff != max_eff, it keeps all logical processors enabled by default (while still allowing explicit override viaSAVAGEWIND_ONE_PER_CORE=1).plat_thread_elevate(), settingTHREAD_PRIORITY_ABOVE_NORMALon Windows for the three critical path threads of frame generation: the guest main thread (KThread id == 1), the NVN render queue thread (queue_thread), and the Vulkan packet recorder thread (run). This ensures Windows Thread Director preferentially schedules the critical path on high-performance P-cores even during heavy bursts of worker activity (such as rune effects, teleporting, or asset streaming).How it was tested
make runtime-objs -j8compiled with 0 warnings or errors under MSYS2 UCRT64 / Clang on Windows 11.make test-pc-controls: PASSmake test-actions: PASSpython3 tools/i18n_check.py: PASSgit diff --check: PASS[cpu]logging on Windows outputs whether hybrid architecture is detected and confirms that all logical processors are retained when P/E cores are present.Checklist
testand opened againsttest