nuttx/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
..
clock Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
environ global change: repace sched_xfree() to kxmm_free() 2020-04-09 10:29:28 -06:00
group Modify SIGSTP to SIGTSTP 2020-10-29 01:12:43 -07:00
init sched/init: init the default home directory to environment 2020-11-09 23:42:46 -08:00
irq sched: irq: Change irq_waitlock() from private to public 2020-12-10 08:33:42 +01:00
module sched/module/mod_modhandle.c: Fix a syslog format 2020-11-21 19:38:32 -08:00
mqueue sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
paging Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
pthread sched/pthread/pthread_getaffinity.c: Fix a syslog format 2020-11-22 19:01:05 -08:00
sched arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
semaphore sched/semaphore/sem_holder.c: Fix syslog formats 2020-11-22 19:01:05 -08:00
signal sched/signal: Remove redundant checks 2020-11-27 05:18:31 -06:00
task arch, sched: Fix global IRQ control logics for SMP 2020-12-10 08:33:42 +01:00
timer sched/timer: add support of CLOCK_MONOTONIC 2020-11-09 15:01:36 -03:00
wdog sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
wqueue sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
Kconfig signal.h: fix compile failed when open TTY_SIGINT 2020-11-05 08:28:53 +01:00
Makefile style/Makefile: remove unnecessary trailing whitespace 2020-11-28 12:20:30 +01:00