Repository navigation
fix(libkernel): inherit process affinity in new guest threads - #3447
Merged
adriadam10 merged 1 commit intoOct 11, 2026
Merged
Conversation
Merged
9 tasks done
Collaborator
|
Checked on Linux: build and ctest green ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New guest threads inherit their creator's effective CPU-affinity mask when thread attributes do not explicitly specify one. Process-wide
cpuset_setaffinityupdates share the thread-registry lock with thread creation, so a concurrent update cannot leave a new thread with a stale mask; explicit attribute affinity remains effective. This is the follow-up documented after merged #3323 and is independent of merged #3384.The regression initializes attributes before changing the process mask, then checks both default inheritance and an explicitly selected attribute mask. The stale-inheritance check failed before the production change and passes with it. The resolved technical-debt sentence was removed.
Tested
Linux/WSL, GCC 13.3, Release full build; commit
21f4be11based on upstream/main74981fabe1c0fc56b561914beb027ddc9b07d358. No title, console, or Windows run.After this rebase, the affected-target rebuild succeeded with ccache disabled:
After this rebase,
ctest --test-dir build --output-on-failure --no-tests=error -R '^guest_available_cpumask$'passed 1/1. In the earlier test-only phase, this regression failed before the production fix.After this rebase,
ctest --test-dir build --output-on-failure --no-tests=error -R '^(guest_(libc_threads|thread_callback_abi|thread_atexit|pthread_.*|thread_self|thread_cpu_clock|cpu_time_clocks|available_cpumask|current_cpu)|cpu_topology|host_thread_local)$'passed 23/23.After this rebase,
python3 tools/check_conventions.py --base upstream/main,git diff --check upstream/main...HEAD, andgit diff --checkpassed.Prior to this rebase, a full
ctest --test-dir build --output-on-failure --no-tests=error --parallel 4 --timeout 30run recorded 757 passed, 36 skipped, and 25 failed out of 818. The full suite has not been rerun at21f4be11.The same 25 cases were rerun under equivalent Release GCC options with ccache disabled on the earlier affinity branch and unchanged upstream/main
74c0f1bd1471967f05bba4fa1a94494dcf9f4e23: all 25 failed on both, with matching categories (14 subprocess aborts, 8 timeouts, 3 assertion failures). This shows those failures also occurred upstream in that environment; it does not establish the cause of each failure.Windows and console behavior have not been validated.
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)The branch's merge base is the current upstream/main
74981fab, confirmed against GitHub. Searches found no open affinity or cpuset PR; open #3442 addspthread_getthreadid_npin different functions and tests. No third-party code was added, so that item is inapplicable and left unchecked. Depends on: none; #3323 is already merged. AI-assisted: yes — Codex implemented and reviewed the change using the AnyPS5 contributor and Ponytail review workflows; the author remains responsible for every line.