nuttx/sched/task
Masayuki Ishikawa 409c65ce0b arch, sched: Fix global IRQ control logics for SMP
Summary:
- This commit fixes global IRQ control logic
- In previous implementation, g_cpu_irqset for a remote CPU was
  set in sched_add_readytorun(), sched_remove_readytorun() and
  up_schedule_sigaction()
- In this implementation, they are removed.
- Instead, in the pause handler, call enter_critical_setion()
  which will call up_cpu_paused() then acquire g_cpu_irqlock
- So if a new task with irqcount > 1 restarts on the remote CPU,
  the CPU will only hold a critical section. Thus, the issue such as
  'POSSIBLE FOR TWO CPUs TO HOLD A CRITICAL SECTION' could be resolved.
- Fix nxsched_resume_scheduler() so that it does not call spin_clrbit()
  if a CPU does not hold a g_cpu_irqset
- Fix nxtask_exit() so that it acquires g_cpu_irqlock
- Update TODO

Impact:
- All SMP implementations

Testing:
- Tested with smp, ostest with the following configurations
- Tested with spresense:wifi_smp (NCPUS=2,4)
- Tested with sabre-6quad:smp (QEMU, dev board)
- Tested with maix-bit:smp (QEMU)
- Tested with esp32-core:smp (QEMU)
- Tested with lc823450-xgevk:rndis

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-12-10 08:33:42 +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
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_exit.c arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
task_exithook.c sched: Fix nx_waitid(), nx_waitpid(), nxtask_exithook() for SMP 2020-11-14 16:31:49 -08: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
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
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_terminate.c sched/task: do not migrate the task state to INVALID 2020-10-28 11:15:22 -07:00
task_testcancel.c
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