Skip to content

fix(libkernel): report the thread policy in attribute queries - #5451

Closed
calbebop wants to merge 1 commit into
boykopovar:mainfrom
calbebop:codex/pthread-attr-scheduling-policy
Closed

calbebop wants to merge 1 commit into
boykopovar:mainfrom
calbebop:codex/pthread-attr-scheduling-policy

Conversation

@calbebop

Copy link
Copy Markdown

What

pthread_attr_get_np leaves the destination attribute's previous scheduling policy unchanged, and scePthreadAttrGet always reports FIFO. Both now copy the thread's stored policy, so attribute queries agree with explicit or inherited creation and later successful scheduling changes.

The regression queries both exports after RR creation and RR → FIFO → RR changes, preloading the destination with the opposite policy before each query. The policy snapshot follows FreeBSD 11.4's attribute query and scheduling update. The debt entry records that applying the same rule to the SCE query has not been measured on PS5 hardware.

Tested

Ubuntu 24.04, GCC 13.3, x86-64, entirely inside Docker Desktop.

  • The new regression fails against unchanged production code at dacd78525. A diagnostic run records incorrect policies in 10 of 12 queries.
  • The corrected regression passes all 12 policy assertions, covering both query exports, both creation modes, and both runtime setter exports.
  • Updated onto main a0f5916a2; all production libraries and the relinker build successfully.
  • All 23 selected pthread/scheduling and patched-library-loading checks pass: ctest -R '^(guest_pthread_.*|guest_available_cpumask|guest_sched_priority|patched_libraries)$'.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.

No Windows, PS5 hardware, or title run was performed. This corrects reported guest metadata; it does not change host scheduling. The entire project test suite was not run.

Checklist

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#4953 docs/dev/debt/libkernel.md L13
#5537 docs/dev/debt/libkernel.md L13
#5553 docs/dev/debt/libkernel.md L13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant