nuttx/sched/sched
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
..
Make.defs sched: sched: Remove sched_tasklistlock.c for SMP 2020-11-10 23:18:08 -08:00
sched_addblocked.c sched: sched: Remove sched_tasklistlock.c for SMP 2020-11-10 23:18:08 -08:00
sched_addprioritized.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_addreadytorun.c arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
sched_continue.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_cpuload_oneshot.c Make more OS internal names consistent 2020-05-10 22:47:07 +08:00
sched_cpuload_period.c Change all files come from Xiaomi/Pinecone to Apache License 2.0 2020-08-22 17:37:21 -06:00
sched_cpuload.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
sched_cpupause.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_cpuselect.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_critmonitor.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_foreach.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
sched_get_stackinfo.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
sched_getaffinity.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
sched_getcpu.c sched/sched/sched_getcpu.c: All new files should have Apache 2.0 headers. 2020-02-02 07:36:34 -08:00
sched_getfiles.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
sched_getparam.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
sched_getscheduler.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
sched_getsockets.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
sched_getstreams.c libc/stdio: Allocate file_struct dynamically 2020-09-11 17:58:17 +08:00
sched_gettcb.c libc/stdio: Allocate file_struct dynamically 2020-09-11 17:58:17 +08:00
sched_idletask.c Squashed commit of the following: 2019-02-04 16:20:35 -06:00
sched_lock.c sched: Fix sched_lock() logic for SMP 2020-10-26 22:22:31 -07:00
sched_lockcount.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_mergepending.c sched: sched: Remove sched_tasklistlock.c for SMP 2020-11-10 23:18:08 -08:00
sched_mergeprioritized.c sched: sched: Remove sched_tasklistlock.c for SMP 2020-11-10 23:18:08 -08:00
sched_note.c Fix build break when CONFIG_TASK_NAME_SIZE == 0 2020-11-01 18:46:26 -08:00
sched_processtimer.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_releasetcb.c Revert "sched/sched/sched_releasetcb.c: Handle custom stack allocations." 2020-07-07 00:21:46 +01:00
sched_removeblocked.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_removereadytorun.c arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
sched_reprioritize.c Run all .c and .h files modifed by the PR though nxstyle. 2020-05-09 16:58:42 -03:00
sched_resumescheduler.c arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
sched_roundrobin.c Sources and Docs: Fix typos and nxstyle issues 2020-10-02 04:54:52 +02:00
sched_rrgetinterval.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
sched_self.c Run nxstyle against all .c and .h files modified by this PR. 2020-05-09 14:19:08 -03:00
sched_setaffinity.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_setparam.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_setpriority.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_setscheduler.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_sporadic.c sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
sched_suspend.c sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
sched_suspendscheduler.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_thistask.c arch, include, sched : Refactor ARCH_GLOBAL_IRQDISABLE related code 2020-09-03 10:20:20 +08:00
sched_timerexpiration.c sched/sched/sched_timerexpiration.c: Fix a syslog format 2020-11-22 19:01:05 -08:00
sched_unlock.c sched: Fix DEBUGASSERT() in sched_unlock() for SMP 2020-10-26 22:22:31 -07:00
sched_verifytcb.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched_wait.c sched: add nx_wait, nx_waitid and nx_waitpid 2020-05-04 07:20:02 -06:00
sched_waitid.c sched/sched/sched_waitid.c: Discard the child entry 2020-12-05 08:45:42 -06:00
sched_waitpid.c sched/sched/sched_waitpid.c: Discard the correct child entry 2020-12-02 09:47:11 +09:00
sched_yield.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
sched.h sched: sched: Remove sched_tasklistlock.c for SMP 2020-11-10 23:18:08 -08:00