nuttx/sched/sched
ligd e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
..
Make.defs sched: Implement sysinfo function 2022-02-08 10:27:38 +08:00
sched_addblocked.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_addprioritized.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_addreadytorun.c sched: Remove the unnecessary "FAR dq_queue_t *" cast 2022-08-31 08:50:57 +09:00
sched_backtrace.c sched/backtrace: Dump the complete stack regardless the depth 2021-12-29 12:09:54 +08:00
sched_continue.c
sched_cpuload_oneshot.c sched: Simplify the cpuload process 2022-08-18 22:11:29 +03:00
sched_cpuload_period.c sched: Simplify the cpuload process 2022-08-18 22:11:29 +03:00
sched_cpuload.c sched: Simplify the cpuload process 2022-08-18 22:11:29 +03:00
sched_cpupause.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_cpuselect.c SMP: fix assert failed when one task set to 255 2022-09-17 17:37:47 +09:00
sched_critmonitor.c sched_critmonitor: remove check zero in sched_critmonitor 2022-07-22 10:15:06 +03:00
sched_foreach.c sched: Remove pidhash_s and move ticks to tcb_s 2021-10-16 06:19:17 -03:00
sched_get_stackinfo.c sched: Refine tls_info_s and task_info_s 2021-07-02 10:33:34 -05:00
sched_getaffinity.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_getcpu.c
sched_getfiles.c
sched_getparam.c Don't include assert.h from public header file 2021-06-03 08:36:03 -07:00
sched_getscheduler.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_getstreams.c Don't include assert.h from public header file 2021-06-03 08:36:03 -07:00
sched_gettcb.c sched: Check g_pidhash[hash_ndx] isn't NULL before access pid field in nxsched_get_tcb 2021-10-17 17:28:57 +09:00
sched_idletask.c pid_t: unify usage of special task IDs 2022-03-22 21:22:32 +08:00
sched_lock.c sched: Remove the unnecessary "FAR dq_queue_t *" cast 2022-08-31 08:50:57 +09:00
sched_lockcount.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_mergepending.c sched: Remove the unnecessary "FAR dq_queue_t *" cast 2022-08-31 08:50:57 +09:00
sched_mergeprioritized.c sched/sched: Fix some typos in comments. 2021-11-18 19:27:40 -06:00
sched_note.c libc/stdio: enable long long formating by CONFIG_HAVE_LONG_LONG 2022-07-13 09:50:38 -03:00
sched_processtimer.c sched: Remove the unnecessary weak_function 2022-08-30 09:42:24 +02:00
sched_releasetcb.c sched: Remove the unnecessary weak_function 2022-08-30 09:42:24 +02:00
sched_removeblocked.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_removereadytorun.c sched: Remove the unnecessary "FAR dq_queue_t *" cast 2022-08-31 08:50:57 +09:00
sched_reprioritize.c
sched_resumescheduler.c SMP: fix crash when switch to new task which is still running 2022-09-17 17:37:47 +09:00
sched_roundrobin.c Sources and Docs: Fix typos and nxstyle issues 2020-10-02 04:54:52 +02:00
sched_rrgetinterval.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_self.c
sched_setaffinity.c sched: sched: Remove sched_lock/unlock from nxsched_set_affinity() 2021-01-20 21:52:58 -08:00
sched_setparam.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_setpriority.c sched/sched_setpriority.c: Fix CPU affinity issues in SMP 2021-09-29 16:23:17 +09:00
sched_setscheduler.c
sched_sporadic.c Fix error: converting the result of '<<' to a boolean always evaluates to true 2022-05-19 23:23:01 +03:00
sched_suspend.c
sched_suspendscheduler.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched_sysinfo.c sched: Implement sysinfo function 2022-02-08 10:27:38 +08:00
sched_thistask.c arch, include, sched : Refactor ARCH_GLOBAL_IRQDISABLE related code 2020-09-03 10:20:20 +08:00
sched_timerexpiration.c cpuload: fix cpuload error 2022-08-27 20:39:41 +08:00
sched_unlock.c sched/sched: Fix some typos in comments. 2021-11-18 19:27:40 -06:00
sched_verifytcb.c Fix various typos 2022-07-08 02:15:54 +08:00
sched_wait.c pid_t: unify usage of special task IDs 2022-03-22 21:22:32 +08:00
sched_waitid.c sched/waitpid: handle waitpid waitting tcb->group is NULL 2021-07-04 06:23:59 -05:00
sched_waitpid.c sched: remove DEBUGASSERT from nx_waitpid 2022-04-22 15:06:26 -03:00
sched_yield.c sched: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched.h sched: Remove the unnecessary "FAR dq_queue_t *" cast 2022-08-31 08:50:57 +09:00