incubator-nuttx/sched/sched
Masayuki Ishikawa 1d958980bd Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615)
Fix SMP related bugs

* sched/sched: Fix a deadlock in SMP mode

    Two months ago, I introduced sched_tasklist_lock() and
    sched_tasklist_unlock() to protect tasklists in SMP mode.
    Actually, this change works pretty well for HTTP audio
    streaming aging test with lc823450-xgevk.

    However, I found a deadlock in the scheduler when I tried
    similar aging tests with DVFS autonomous mode where CPU
    clock speed changed based on cpu load. In this case, call
    sequences were as follows;

    cpu1: sched_unlock()->sched_mergepending()->sched_addreadytorun()->up_cpu_pause()
    cpu0: sched_lock()->sched_mergepending()

    To avoid this deadlock, I added sched_tasklist_unlock() when calling
    up_cpu_pause() and sched_addreadytorun(). Also, added
    sched_tasklist_lock() after the call.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* libc: Add critical section in lib_filesem.c for SMP

    To set my_pid into fs_folder atomically in SMP mode,
    critical section API must be used.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* mm: Add critical section in mm_sem.c for SMP

    To set my_pid into mm_folder atomically in SMP mode,
    critical section API must be used.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* net: Add critical section in net_lock.c for SMP

    To set my pid (me) into fs_folder atomically in SMP mode,
    critical section API must be used.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-20 12:34:38 +00:00
..
Make.defs sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
sched.h sched/sched: Extend the last global lock change to work with the lc823450-xgevk which does not support the atomic fetch add but does support disabling interprocessor interrupts. Disabling interprocessor interrupts will also guarantee that the TCB addres calculation is atomic. 2018-02-05 13:32:09 -06:00
sched_addblocked.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_addprioritized.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_addreadytorun.c Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
sched_cpuload.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_cpuload_oneshot.c CPU load: Correct computation of the nominal period to use when the source is a oneshot timer. 2017-01-22 07:12:22 -06:00
sched_cpupause.c sched_note: Extend OS instrumentation to include some SMP events. 2016-11-27 17:14:57 -06:00
sched_cpuselect.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_foreach.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_free.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_garbage.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_getaffinity.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
sched_getfiles.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_getparam.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_getscheduler.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_getsockets.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_getstreams.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_gettcb.c
sched_idletask.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_lock.c sched/sched: sched_lock() and sched_unlock().. back out some changes I made recently. The seemed correct but apparently not. Also reorder to logic so that g_global_lockcount is incremented for the very minimum amount of time. 2018-02-06 13:49:21 -06: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 Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
sched_mergeprioritized.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_note.c SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note() 2018-01-17 13:29:42 +09:00
sched_processtimer.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_releasetcb.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_removeblocked.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_removereadytorun.c Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
sched_reprioritize.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_resumescheduler.c SMP: Introduce a new global IRQ clearing logic and tasklist protection. 2018-01-31 15:35:36 +09:00
sched_roundrobin.c sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
sched_rrgetinterval.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_self.c
sched_setaffinity.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_setparam.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_setpriority.c sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
sched_setscheduler.c Fix various issues noted by Coverity 2018-02-06 09:13:16 -06:00
sched_sporadic.c sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
sched_suspendscheduler.c Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
sched_tasklistlock.c SMP: Introduce a new global IRQ clearing logic and tasklist protection. 2018-01-31 15:35:36 +09:00
sched_thistask.c Standardization of some function headers. 2018-03-13 09:56:16 -06:00
sched_timerexpiration.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_unlock.c sched/sched: sched_lock() and sched_unlock().. back out some changes I made recently. The seemed correct but apparently not. Also reorder to logic so that g_global_lockcount is incremented for the very minimum amount of time. 2018-02-06 13:49:21 -06:00
sched_verifytcb.c Update some comments. 2017-09-11 14:27:02 -06:00
sched_wait.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_waitid.c Squashed commit of the following: 2017-10-07 08:22:18 -06:00
sched_waitpid.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_yield.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00