rt-thread/components/lwp
Shell f179ce12b7
[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 <smokewood@qq.com>
2024-05-29 06:53:22 +08:00
..
arch [lwp/riscv]进入libc前初始化用户态sp (#8997) 2024-05-29 06:52:38 +08:00
terminal [smart] add FIONREAD ioctl support for tty (#8996) 2024-05-28 09:56:10 +08:00
Kconfig [drivers/serial] Introduce hooker for TTY (#8733) 2024-04-09 21:36:16 +08:00
SConscript sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
libc_musl.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp.c [smart] select console device dynamically (#8949) 2024-05-17 13:19:00 +08:00
lwp.h [smart] update sched_setaffinity() to use thread(task) ID (#9004) 2024-05-29 06:53:22 +08:00
lwp_arch_comm.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_avl.c [rtdef] use lower-case to define attributes (#6728) 2022-12-11 13:12:03 -05:00
lwp_avl.h sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_dbg.c sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_dbg.h [component/lwp] support more feature of signal from IEEE Std 1003.1-2017 (#7828) 2023-07-20 00:02:41 +08:00
lwp_elf.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_elf.h sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_futex.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_futex_internal.h 🎯 Sync smart & scheduler codes (#8537) 2024-02-23 17:49:15 +08:00
lwp_futex_table.c 🎯 Sync smart & scheduler codes (#8537) 2024-02-23 17:49:15 +08:00
lwp_internal.c [fixup] aarch64 UMP compiler error (#8677) 2024-03-30 17:58:38 +08:00
lwp_internal.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_ipc.c 🎯 Sync smart & scheduler codes (#8537) 2024-02-23 17:49:15 +08:00
lwp_ipc.h fix rt_channel lock. (#8244) 2023-11-10 21:37:07 +08:00
lwp_ipc_internal.h sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_itimer.c 🎯 Sync smart & scheduler codes (#8537) 2024-02-23 17:49:15 +08:00
lwp_jobctrl.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_mm.c sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_mm.h sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_pgrp.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_pid.c [smart] update sched_setaffinity() to use thread(task) ID (#9004) 2024-05-29 06:53:22 +08:00
lwp_pid.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_session.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_shm.c Sync dfs lwp (#8123) 2023-10-17 13:07:59 +08:00
lwp_shm.h sync branch rt-smart. (#6641) 2022-12-03 12:07:44 +08:00
lwp_signal.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_signal.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_sys_socket.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_syscall.c [smart] update sched_setaffinity() to use thread(task) ID (#9004) 2024-05-29 06:53:22 +08:00
lwp_syscall.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_tid.c sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
lwp_user_mm.c [smart] fixup arm64 aspace switch (#8925) 2024-05-10 09:17:19 +08:00
lwp_user_mm.h sync smart & dfs (#8672) 2024-03-28 23:42:56 +08:00
page.h [rt-smart] kernel virtual memory management layer (#6809) 2023-01-08 21:08:55 -05:00
syscall_generic.h Sync dfs lwp (#8123) 2023-10-17 13:07:59 +08:00