nuttx/sched
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
..
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 Modify SIGSTP to SIGTSTP 2020-10-29 01:12:43 -07:00
irq sched: irq: Fix enter_critical_section() in an irq handler for SMP 2020-11-03 08:19:41 +01:00
module modsym: Fix a printf format for berr 2020-04-13 16:20:09 +01: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 Revert "sched: Call up_[use|create]_stack after nxtask_setup_scheduler" 2020-10-22 18:31:31 +09:00
sched sched/sched/sched_waitid.c: Allow WNOHANG 2020-11-06 00:44:55 -08:00
semaphore sched/wdog: Remove MAX_WDOGPARMS and related stuff 2020-08-14 08:19:50 -06:00
signal sched/signal: Fix typos 2020-11-03 01:30:14 -08:00
task sched: task: Fix nxtask_exit() for SMP 2020-11-09 10:59:20 +01:00
timer Fix nxstyle warning 2020-08-22 17:37:21 -06: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 Makefile: Fix Make.dep not updated by config changes 2020-07-28 03:59:45 -05:00