docs(libkernel): drop stale mlockall, open file limit and protection bit claims #9363
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9363"
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 thuanquang on 2026-10-21T19:20:53Z.
What
Four statements in
docs/dev/debt/libkernel.mdno longer matchmain; each is replaced with whatmaindoes now, and nothing else in the entries changes.mlockall_nid_postfixis at core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp:311 (a7ea2bdcaa, #4386) andmunlockall_nid_postfixis at :320 (e03e6f7a4e, #5663). Both sit in theextern "C"block with no platform guard, and their NIDs, x7g7Ebeo8-U and NpLBpgVV7PU, are the two XPSemu imports those commits name.e03e6f7a4ewrote this sentence, so it described main before #5663 merged. Now: "XPSemu (PPSA97358) importsmlockallandmunlockall".mlockallimport (#4386)".mlockallis exported at core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp:311. It came froma7ea2bdcaain #4386, which merged (bc1ded3a18) before #4377 (8d455b8018, merge40047f46bd) added this clause, so the clause was already stale when it landed. The remaining text, "current-main runtime reachability is unverified", still records the open gap. Now: "" (clause removed).core/libs/prx/libkernel/File/src/OpenFileLimit.cppis__linux__-only, so on macOS the guest gets whatever soft limit the host process inherited." core/libs/prx/libkernel/File/src/OpenFileLimit.cpp:1 is now#if defined(__linux__) || defined(__APPLE__). Lines :16-26 set both limits at load to the hard limit, which on macOS is first lowered tokern.maxfilesperproc(0cb9d92b56, #6836). The getrlimit entry already gives these per-host values. The guest limit equals the host's soft limit only off Windows (core/libs/prx/libkernel/System/src/Process.cpp:754-758); Windows uses a fixed 8192 (:751-753). Now: "On Linux and macOS the guest limit is the host's soft limit."prot & 0x113to host read andprot & 0x222to host read/write, so 0x100 and 0x200 grant host access like the GPU bits. That changed inb567bb8eed(#900), which merged after #550 (49b2f9e49b) wrote this entry. The 'Memory protection bits 0x100 and 0x200' entry (docs/dev/debt/libkernel.md:57) already says this and gives its sources, so the whole bullet goes. Now: "" (bullet removed).Tested
Docs only; nothing was built or run. On origin/main
0ae788741d, I read PosixMemory.cpp (the mlockall and munlockall exports at :311 and :320, in the extern C block from :147 with no guard after :229), OpenFileLimit.cpp, Process.cpp:748-762 and 827-837 (the guest RLIMIT_NOFILE and getdtablesize) and DirectMemory.cpp:265-275 (LinuxProtFromSce); I also checked each change's commits and merge order and recomputed the mlockall and munlockall NIDs with the tools/nid_names.py algorithm (x7g7Ebeo8-U, NpLBpgVV7PU). Rebased onmain0ae788741d: #10136 rewrote the neighbouringclose, sceKernelCloseentry, which stays asmainhas it. Of the cited source files only Process.cpp changed since6ef5a1c4c9(#8537, #8985, #8986, #9218); its open file limit code only moved, and the 'Memory protection bits' entry is now at :57. Each statement was found by a read-only sweep of the debt files and confirmed by two independent verifier passes and a final check on currentmain. No open pull request edits these sentences:tools/pr_overlap.py --branchon0ae788741dfound no overlap, and I checked by hand the diffs of the 33 open PRs that edit this file but could not be compared because they conflict withmain.python tools/check_conventions.py --base origin/mainwith this title and body: 0 errors and 1debt-lengthwarning, for entries that were already over 1000 characters: mlockall, munlockall (1067 characters before, 1034 after this change).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)🤖 Generated with Claude Code