fix(libkernel): report current thread scheduling policy in attributes #8583
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8583"
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 Ondra97 on 2026-10-20T17:23:53Z.
What
scePthreadAttrGetalways writes FIFO, even whenscePthreadGetschedparamreports RR for the same live thread.pthread_attr_get_npleaves the destination's previous policy untouched. Both attribute queries now read the thread's existing atomic scheduling-policy metadata.The scheduling regression checks both APIs with destinations preseeded to FIFO and RR, queries from the thread itself and from another thread, explicit and inherited creation policies, subsequent policy changes, rejected setters, and the existing SCE ESRCH result after join. The guest constants have a
GUEST_prefix because<future>brings in host scheduling macros.The policy-copy behavior follows FreeBSD 11.4 libthr's attribute query, whose copy range includes the policy; setschedparam updates that attribute. The console result of these attribute queries has not been measured, and that limit is recorded in the library's technical debt. Host scheduling is still unaffected. This addresses CORE 01 in #8005; no title compatibility claim is made.
Tested
Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs GCC 15.2.0 UCRT r7; Release with
BUILD_TESTING=ON.Base:
1b08a33b121e23a4f9e84999c233e094b5055893. Fix:ad1650686c0686bd6971eda5a7e40c74cc319279.guest_pthread_schedparamregressionThe probe uses a live guest thread, FIFO/RR settings, both attribute-query APIs and both destination policies. The committed regression also covers creation, inheritance, changes to another gated thread, and SCE ended-thread behavior. The unchanged
guest_pthread_attrandguest_pthread_attr_errorstests pass before and after.The overlap checker reports no confirmed conflicts. I manually reviewed its incomplete shared-file comparisons: #6893 changes guard-size fields, #6044 moves the unchanged scheduling test, and the debt changes concern other entries. #8041's guard-size change also leaves the policy untouched. None supplies this fix or is a prerequisite.
No console modules or game payloads are needed by the regression. No game run was performed.
Full all-target Windows Release build passed. The final seven runtime tests passed, including loading 354 patched libraries with zero failures. The full build used a temporary alignment adjustment confined to an unrelated existing test; it was restored afterward and is absent from the submitted diff.
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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T17:38:16Z.
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.
docs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/tests/GuestPthreadSchedparam.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.md