nuttx/sched
wangzhi16 01f7ff2bb7 sched/sched: Fix bug of sched_setaffinity()
TESTCASE: A thread running on CPU0 calls sched_setaffinity() to run on CPU1, but the execution result shows that only the value of tcb->affinity is modified, and it does not actually switch to CPU1.

REASON: The underlying function nxsched_running_setpriority() called by sched_setaffinity does not take into account that when changing CPU affinity, each CPU's task queue needs to be adjusted and context switching needs to be performed. Therefore, it is necessary to add a check to see if the new CPU affinity also includes the previously running CPU. If not, the task needs to be put into the new CPU queue and context switching needs to be performed.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 22:11:17 +08:00
..
addrenv sched/addrenv: replace critical section with spinlock for refs protection 2026-01-20 11:29:22 +08:00
clock sched/clock: [bugfix] should return -EINVAL when clock_id is invalid 2025-12-30 10:22:09 -03:00
environ libc/environ: add interrupt context check to getenv 2026-01-21 10:37:55 +08:00
event sched/event: Fix uninitialized need_switch flag issue in event_post() 2025-11-04 21:43:59 +08:00
group sched: move process ID from kernel to TLS for faster access 2026-01-20 22:33:45 +08:00
hrtimer sched/hrtimer: add option for list-based hrtimer management 2026-01-21 10:33:12 +08:00
init sched/init: use enum type for g_nx_initstate 2026-01-21 20:31:35 +08:00
instrument gprof: move gprof function from sched to libbuiltin/libgcc 2024-11-13 02:42:31 +08:00
irq sched/irq: declare the object in scope 2026-01-22 08:50:30 -03:00
misc sched/signal: Add support for disabling all signal functions 2026-01-18 08:24:13 -03:00
module libc/elf: rename modlib to libelf 2025-04-11 09:43:22 +08:00
mqueue sched: After nxsched_add_readytorun, change first parameter to up_switch_context to this_task() 2025-08-20 10:16:43 +08:00
paging sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
pthread sched/pthread: remove duplicate robust mutex checking logic 2026-01-21 10:12:22 +08:00
sched sched/sched: Fix bug of sched_setaffinity() 2026-01-22 22:11:17 +08:00
semaphore semaphore/sem_trywait.c: Remove redundancy leave_critical_section 2026-01-21 14:27:14 +08:00
signal sched/signal: Add support for disabling all signal functions 2026-01-18 08:24:13 -03:00
task sched/task: task_setup return path cleanup 2026-01-21 20:31:35 +08:00
timer sched/wdog: Replace periodcial timer with the wd_start_next. 2025-06-10 11:02:45 -03:00
tls sched/tls: fix thread ID initialization in tls_dup_info 2026-01-21 10:34:27 +08:00
wdog sched/wdog: Simplify the wd_timer_start. 2026-01-22 19:31:28 +08:00
wqueue sched/wqueue: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt 2025-10-31 15:02:56 +08:00
CMakeLists.txt sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
Kconfig sched/hrtimer: add option for list-based hrtimer management 2026-01-21 10:33:12 +08:00
Makefile sched/hrtimer: Fix hrtimer compilation. 2026-01-08 22:26:11 +08:00