nuttx/sched/task
Masayuki Ishikawa 2395ab7f6e sched: task: Fix nxtask_exit() for SMP
Summary:
- I noticed that nxsched_merge_pending() is called outside a critical section
- The issue happens if a new rtcb does not hold a critical section
- Actually, global IRQ control is done in nxsched_resume_scheduler() in nxtask_exit()
- However, nxsched_merge_pending() was called after calling nxsched_resume_scheduler()
- This commit fixes the issue by moving nxsched_merge_pending() before the function
- NOTE: the sequence was changed for SMP but works for non-SMP as well

Impact:
- This commit affects both SMP and non-SMP

Testing:
- Tested with ostest with the following configurations
- spresense:wifi_smp (NCPUS=2 and 4)
- spresense:wifi (non SMP)
- sabre-6quad:smp (QEMU)
- esp32-core:smp (QEMU)
- maix-bit:smp (QEMU)
- sim:smp
- lc823450-xgevk:rndis

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-11-09 10:59:20 +01:00
..
exit.c sched: Remove SCHED_EXIT_KILL_CHILDREN option 2020-06-15 07:17:43 -06:00
Make.defs Move gettid() implementation to /libs/libc/unistd 2020-09-22 19:40:56 -07:00
spawn.h Check return from nxsem_wait_initialize() 2020-03-29 20:11:10 +01:00
task_activate.c sched: Change the return type of nxtask_activate to void 2020-06-04 22:20:45 +01:00
task_atexit.c sched/task: Avoid the cast in atexit when CONFIG_SCHED_ONEXIT is defined 2020-06-05 13:29:22 +01:00
task_cancelpt.c sched: Consolidate the cancellation notification logic 2020-06-15 21:21:14 +01:00
task_create.c sched: Change tcb_s to task_tcb_s for nxtask_[un]init 2020-06-30 10:54:42 -06:00
task_delete.c sched: Consolidate the cancellation notification logic 2020-06-15 21:21:14 +01:00
task_execv.c task_execv.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_exit.c sched: task: Fix nxtask_exit() for SMP 2020-11-09 10:59:20 +01:00
task_exithook.c sched/task/task_exithook.c: Remove a redundant assignment 2020-11-07 11:14:43 +01:00
task_getgroup.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_getpid.c Some cosmetic updates, mostly to spacing and comments. 2018-12-30 11:58:19 -06:00
task_init.c Revert "sched: Call up_[use|create]_stack after nxtask_setup_scheduler" 2020-10-22 18:31:31 +09:00
task_onexit.c sched/task: Simplify atexit and onexit implementation 2020-06-05 13:29:22 +01:00
task_posixspawn.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_prctl.c syscall/prctl: fix PR_SET_NAME failure if without <pid> arg 2020-07-01 21:52:18 -05:00
task_recover.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
task_reparent.c sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
task_restart.c sched/group: Change group_kill_children's argument from task_tcb_s to tcb_s 2020-06-15 07:09:51 -06:00
task_setcancelstate.c sched: Don't call nxnotify_cancellation in task_setcancelstate 2020-06-15 21:21:14 +01:00
task_setcanceltype.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
task_setup.c Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
task_spawn.c sched/task/task_spawn.c: Fix duplicate task_spawn() 2020-06-01 16:40:06 +01:00
task_spawnparms.c sched: use nx_close instead of close 2020-10-28 09:11:50 -07:00
task_start.c sched: nxtask_start should call entry point directly for kernel thread 2020-10-08 09:14:33 +02:00
task_starthook.c task_starthook.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_terminate.c sched/task: do not migrate the task state to INVALID 2020-10-28 11:15:22 -07:00
task_testcancel.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
task_vfork.c sched: Change the return type of nxtask_activate to void 2020-06-04 22:20:45 +01:00
task.h sched: Consolidate the cancellation notification logic 2020-06-15 21:21:14 +01:00