Repository navigation
feat(libkernel_sys): implement pthread_set_defaultstacksize_np, scePthreadSetDefaultstacksize and scePthreadSetName - #9279
Conversation
…hreadSetDefaultstacksize and scePthreadSetName
|
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.
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.
|
|
Independent Windows run of this PR (data only). Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against PR head tested: Results (3 runs each):
Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code). |
|
@oneandonlydean @adriadam10 ready from my side: CI is green, it merges cleanly, and xXPBSXx's Windows run shows the test passing here and failing with |
|
@YossiYad thanks, it's in my review queue now. I'll come back here with the result. |
What
Three libkernel_sys exports threw. They now follow fpPS4's libkernel (LGPL-2.1):
pthread_set_defaultstacksize_np(size)sets the stack size used byscePthreadAttrInitand byscePthreadCreatewithout attributes. A size of 16384 bytes or less returnsEINVALand keeps the old default.scePthreadSetDefaultstacksizeis the same call returning0x80020016instead.scePthreadSetName(thread, name)returns nothing and renames the thread through the existingpthread_set_name_np, so a null name clears it (fpPS4).The default used to be a
constexprof 1 MiB written twice, inAttr.cppandThread.cpp. It is now one atomic inAttr.cpp, read by both, still starting at 1 MiB. Attributes initialised before a change keep their size.Not measured on a PS5; the debt entry says where the rule comes from.
Tested
Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), based onmaind34da5d694:guest_kernel_sys_thread_defaults(core/libs/tests/GuestKernelSysThreadDefaults.cpp): sizes 0 and 16384 are refused by both forms and leave the default alone, 16385 is taken, a new attribute and a thread created without attributes report the new size, andscePthreadSetNamesets and clears the name read back withscePthreadGetname. It aborts onmain. Each of these changes made it fail: accepting 16384,scePthreadAttrInitorscePthreadCreatekeeping 1 MiB,scePthreadSetNamedoing nothing, and the sce form returning the errno.ctest: 1795 of 1803 pass. The 8 failures fail the same way onmainon this machine and do not use these exports:application_heap_scripting,application_heap_lazy,agc_driver_guest_memory_lifetime,agc_driver_image_array_window_past_layer_limit,agc_driver_tessellationand the threenet_dontwait_blocking_*cases.tools/progress.py --compare: libraries +0.03%, 3 functions implemented, none lost.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.py: no open PR implements these three. feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms #9141 rewritesscePthreadSetconcurrencyright after thescePthreadSetNamestub this removes, so whichever merges second needs a small rebase. feat(libkernel_sys): identify the initial pthread #9160 adds lines near the removedDEFAULT_STACK_SIZEinThread.cpp, separated by unchanged lines.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)