fix(libkernel): accept SCHED_OTHER in sched_get_priority_max/min #1908
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1908"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T23:23:34Z.
What
sched_get_priority_maxandsched_get_priority_minaccepted onlySCHED_FIFO(1) andSCHED_RR(3) and threw forSCHED_OTHER(2). SDL queries theSCHED_OTHERrange before it sets a thread priority, so SDL titles stopped there. Quake II (PPSA99007, the homebrew port) hits it at startup.SCHED_OTHERnow reports the same 256 to 767 range as the other two policies.pthread_setschedparamapplies a priority regardless of policy, so a priority taken from this range works. Policies outside 1-3 still throw.What the console reports for
SCHED_OTHERis unverified. FreeBSD accepts it with its own range, and shadPS4 rejects it withEINVAL. TechnicalDebt records this.core/libs/prx/libkernel/System/src/Process.cpp: accept policies 1-3.guest_sched_priority: policies 1, 2 and 3 report max 256 and min 767, and 0 and 4 throw.docs/dev/TechnicalDebt.md: the entry above.Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.
mainwith this PR and four other small PRs of mine merged together (SCHED_OTHER priority range, MAP_ALIGNED_SUPER, the compatible pad vibration mode, empty-PT_TLS stack-guard reads, pthread_attr scope/getters). It was run from the generatedCTestTestfile.cmakecommands because antivirus blocksctest.exeon this machine.tools/check_conventions.py --base origin/mainpasses on this branch alone.Not tested on Linux or macOS.
Checklist
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 (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T01:35:41Z.
Review: COMMENTED
I reviewed the full diff. The validation change accepts only
SCHED_OTHERin addition to the existing policies, keeps other values rejected, and the focused test covers both limits and invalid policies. The console range uncertainty is recorded in TechnicalDebt. The current-head Build, Windows and Linux suites, and Conventions checks are green. I found no blocking issue.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T06:00:41Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/CMakeLists.txtL529