summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
authorShell <[email protected]>2024-05-29 06:53:22 +0800
committerGitHub <[email protected]>2024-05-29 06:53:22 +0800
commitf179ce12b71c01a5fba3b79f00e245178f482483 (patch)
treeb70bfae5edffe38d4363f99d89438aaea15d81ad /src/SConscript
parent326150e2f4991679f5a4e39cfdc42378a328e983 (diff)
[smart] update sched_setaffinity() to use thread(task) ID (#9004)
Correct `sched_setaffinity()` to use the thread IDs (TIDs) instead of process IDs (PIDs). The previous implementation used PIDs, which caused issues since affinity settings need to be applied at the thread level. As the manual documented, the signature is: > int sched_setaffinity(pid_t pid, size_t cpusetsize, > const cpu_set_t *mask); Yes, it's tricky, the identification passing in is called **'PID'**. But when we talk about 'pid' from GNU libc, it's the **'task-id'**, aka, `thread->tid` known in kernel. Changes were made by updating the function signatures and logic in `lwp.h`, `lwp_pid.c`, and `lwp_syscall.c` to accept TIDs. Specifically, the `lwp_setaffinity` function and related internal functions now operate using thread IDs and adjust thread affinity settings accordingly Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'src/SConscript')
0 files changed, 0 insertions, 0 deletions