Repository navigation
fix(libSceJobManager): keep persistent workers spinning without the shared lock - #13999
Conversation
…hared lock The keep-alive branch every persistent worker takes on an idle manager dropped and retook manager.lock around each spin window, so with several workerCount threads the releaser retook the lock before a queued waiter woke and the other workers starved inside lock acquisition. Burn the idle window on the workEpoch snapshot without the lock and relock only when dispatches, the persistent count or shutdown changed it, as WakeWorkers, StopManager and setPersistentThreadCount bump it.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
At head f0c452699298fa3c2882e820cec591e463b65c1c against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134, the persistent-worker idle loop now waits on the atomic epoch without holding the manager lock; dispatch, shutdown, and persistent-count changes advance that epoch so the worker can reacquire the lock and recheck state (idle loop, dispatch wake, shutdown and persistent-count updates). git diff --check, conventions/template validation, and the current-base merge preview passed; hosted Windows passed. The Linux test and Vulkan results are author-reported, Linux CI was skipped, and I did not build or run tests locally.
|
Sorry miss-click |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Checked that every path that makes work runnable ( |
What
Persistent workers repeatedly reacquire the shared manager mutex while idle. On the Windows host reported in #13026, one worker can monopolize that mutex and leave the other persistent workers blocked.
Keep persistent workers spinning on
workEpochoutside the mutex until dispatch, shutdown, or a persistent-count change advances the epoch. Preserve the bounded timer-spin path and the existing sleep and wake-token accounting.The overlap warning for #10249 was checked manually: its JobManager hunk changes
Sequence::SubmitCompute, while this PR changesWorkerEntry; neither depends on the other.Tested
worker_countpassed ten direct runs. Hosted Windows CI passed.mainate67cc81869: rebuilt the five JobManager test targets;ctest --test-dir build -R '^guest_job_manager_' --output-on-failurepassed 29/29. The tests ran outside the Codex sandbox because its syscall filter denies the checked guest-memory writes.git diff --checkand convention/template checks passed against current upstreammain. The required--base origin/maincheck also passed with eight pre-existing debt-length warnings from the fork's older base.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)