Repository navigation
Conversation
|
I found that the previous head of #1551 duplicated the same four production substitutions as this PR. I have re-scoped #1551 to add and register only a focused |
|
The updated test-only head of #1551 has now passed its fork Build: 495/495 Linux tests, 486/486 Windows tests, and all three relinker jobs. Its diff contains only |
|
Windows numbers for this, since it's only been run on Linux so far. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), with the 0.5 ms timer resolution libkernel sets.
So on Windows each of these polls goes from a busy spin to a 0.5 ms wait, 10–50 times the requested pause. On Linux they sleep roughly 60 µs.
🤖 Addressed by Claude Code |
|
I have integrated the four production call-site changes from #1576 into my #1551, alongside its focused |
Update on the overlapping wait changesI have rebased #1551 onto current #1576 currently has no checks reported, while #1551 still needs the repository-required upstream Build/relinker run. Please close #1576 as superseded once that required validation is recorded on #1551, so reviewers only have to land one copy of the call-site changes. |
Consolidation statusI refreshed Marc's existing PR #1551 onto upstream
Could you close #1576 so the same production change is not reviewed twice? Please keep this PR open if you have additional behavior or evidence that is not covered by #1551; we can review that separately. |
|
Closing as a duplicate: #1551 now carries the same four call-site changes ( Two points from @popcoder565's Windows measurements that are worth addressing in #1551: each wait becomes ~0.5 ms instead of 10-50 µs, and the AIO loops don't run in practice, so that hunk changes nothing measurable. Thanks for the patch; feel free to reopen if #1551 doesn't move forward. |
Coordination requested after the #1551 reviewThe reviewer on #1551 confirmed that both open PRs currently contain the same four production call-site changes and asked us to choose one carrier. I have preserved your call-site work in #1551 with you credited as co-author; #1551 also contains the focused helper regression test. I prefer #1551 as the single carrier. Could you confirm whether you agree to close #1576 as superseded once its changes are retained in #1551? If you prefer #1576 to carry the production changes, please say so and I will remove those call-site edits from #1551. I will not ask for both PRs to merge. |
What
Addresses the sub-millisecond sleep busy-spin issue documented in #1471:
On Windows,
std::this_thread::sleep_forgoes through winpthreads'nanosleep, which truncates sub-millisecond durations (tv_nsec / 1'000'000) to 0 ms and returns immediately without sleeping or yielding. As a result, polling loops requesting sub-millisecond pauses spin at 100% CPU.This PR switches the sub-millisecond host waits in four areas to use
PreciseSleepUs()(which uses a Windows high-resolution waitable timerCREATE_WAITABLE_TIMER_HIGH_RESOLUTIONon Windows and standard microsecond sleep on POSIX):core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:WAIT_REG_MEMpolling loop (50 µs)core/libs/prx/libkernel/Apr/src/Apr.cpp:_executecounter and address wait loop (50 µs)core/libs/prx/libkernel/Aio/src/Aio.cpp:sceKernelAioWaitRequestsandsceKernelAioWaitRequestpolling loops (10 µs)core/libs/prx/libSceFont/src/State.cpp:Font::Backoffspinlock backoff (30 µs)Tested
ctest -R 'guest_aio|guest_ampr|guest_font': 4/4 passed (100% tests passed:guest_ampr_markers,guest_font,guest_font_writing_line,guest_aio)python tools/check_conventions.py --base origin/main: 100% passedChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository