nuttx/sched/task
Masayuki Ishikawa d295f11a3a SMP: Introduce a new global IRQ clearing logic and tasklist protection.
The previous implementation of clearing global IRQ in sched_addreadytorun()
and sched_removereadytorun() was done too early. As a result, nxsem_post()
would have a chance to enter the critical section even nxsem_wait() is
still not in blocked state. This patch moves clearing global IRQ controls
from sched_addreadytorun() and sched_removereadytorun() to sched_resumescheduler()
to ensure that nxsem_post() can enter the critical section correctly.

For this change, sched_resumescheduler.c is always necessary for SMP configuration.
In addition, by this change, task_exit() had to be modified so that it calls
sched_resumescheduler() because it calls sched_removescheduler() inside the
function, otherwise it will cause a deadlock.

However, I encountered another DEBUGASSERT() in sched_cpu_select() during
HTTP streaming aging test on lc823450-xgevk. Actually sched_cpu_select()
accesses the g_assignedtasks which might be changed by another CPU. Similarly,
other tasklists might be modified simultaneously if both CPUs are executing
scheduling logic. To avoid this, I introduced tasklist protetion APIs.

With these changes, SMP kernel stability has been much improved.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-31 15:35:36 +09:00
..
exit.c
Make.defs Add task_testcancel() 2016-12-10 16:34:14 -06:00
spawn.h Squashed commit of the following: 2017-10-03 15:35:24 -06:00
task_activate.c
task_atexit.c
task_cancelpt.c sched/signal: Add logic to wake up a thread that is waiting on a signal if it is canceled. 2017-10-12 08:55:19 -06:00
task_create.c sched/: Various fixes for typos, improved parameter verification. 2018-01-12 18:26:45 -06:00
task_delete.c task_delete(): Do not permit user applications to delete kernel threads. 2017-10-16 09:07:27 -06:00
task_execv.c sched/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 16:42:42 -06:00
task_exit.c SMP: Introduce a new global IRQ clearing logic and tasklist protection. 2018-01-31 15:35:36 +09:00
task_exithook.c sched/task/task_exithook.c: Clear atexit() function pointer before calling it. On most archs, up_assert() calls exit() so without this change, if atexit() function triggers an assertion we are in endless loop. 2017-11-30 06:41:57 -06:00
task_getgroup.c Remove more of those annoying empty comment blocks. 2016-11-21 07:34:27 -06:00
task_getpid.c Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
task_init.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
task_onexit.c
task_posixspawn.c Squashed commit of the following: 2018-01-30 11:08:18 -06:00
task_prctl.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
task_recover.c Squashed commit of the following: 2017-10-09 09:06:46 -06:00
task_reparent.c sched: Fix tg_flags check with GROUP_FLAG_NOCLDWAIT 2017-04-14 14:50:44 +09:00
task_restart.c This change renames all internal, private NuttX signal-related functions to use the prefix nxsig_ so that they cannot be confused with application interfaces that begin, primarily, with sig_ 2017-10-05 13:25:25 -06:00
task_setcancelstate.c Add task_setcanceltype() 2016-12-10 16:06:14 -06:00
task_setcanceltype.c sched/: Various fixes for typos, improved parameter verification. 2018-01-12 18:26:45 -06:00
task_setup.c Update comments, mostly spelling errors. 2018-01-27 09:37:46 -06:00
task_spawn.c Squashed commit of the following: 2018-01-30 11:08:18 -06:00
task_spawnparms.c sched/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). Add new nxsched_setscheduler() and nxsched_getaffinity() which are equivalent to their counterparts without the nx on front. These versions do not modify the errno value. Changed all calls within the OS to use these newer versions of the functions. 2018-01-30 16:16:41 -06:00
task_start.c binfmt: Don't schedule starthook if there are no constructors. 2017-10-02 14:04:50 -06:00
task_starthook.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
task_terminate.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
task_testcancel.c Add task_testcancel() 2016-12-10 16:34:14 -06:00
task_vfork.c Update comments, mostly spelling errors. 2018-01-27 09:37:46 -06:00
task.h Flesh basic cancellation point support 2016-12-09 09:44:23 -06:00