incubator-nuttx/libc/misc
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
..
Kconfig libc/Kconfig: Break big Kconfig up into separate Kconfig files in each libc subdirectory. 2017-02-10 09:32:55 -06:00
Make.defs setvbuf: Add support for disabling I/O buffering. Initially cut; untested. 2017-02-09 09:24:44 -06:00
lib_crc8.c Remove dangling whitespace at the end of some lines. 2017-06-28 10:39:54 -06:00
lib_crc16.c
lib_crc32.c
lib_crc64.c More fixes for compilation with current SDCC compiler 2017-09-30 15:28:04 -06:00
lib_debug.c Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and debug wrappers -- does not return a value. Rename _vsyslog to nx_vsyslog. Use internal nx_vsyslog in the few cases where a return value is required. 2018-03-04 08:07:07 -06:00
lib_dumpbuffer.c
lib_filesem.c Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
lib_ioctl.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
lib_kbddecode.c
lib_kbdencode.c
lib_match.c
lib_mkfifo.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
lib_ncompress.c sched/sched: SMP: Fix this_task() to be an atomic operation. In the previous implementation, this_task() was defined in sched.h by using just a macro current_task(this_cpu()). However, I found that this is not atomic and actually sometimes switching CPU happened in executing the macro when we tested audio steaming plus executing commands via telnet. This change resolves this issue by implementing atomic this_task()in sched_thistask.c which is newly introduced. 2018-02-04 16:59:09 -06:00
lib_sendfile.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
lib_slcddecode.c
lib_slcdencode.c
lib_stream.c libc and libnx: When the libraries are built into two libraries, a user space library and a OS space library (as in the PROTECTED and KERNEL build). Then the user space library must not use the OS internal interfaces; similarly, the OS must avoid using the userspace interfaces so that it does not muck the errno value or create spurious cancellation points. 2017-10-08 11:52:32 -06:00
lib_streamsem.c Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603) 2018-02-20 18:24:53 +00:00
lib_tea_decrypt.c
lib_tea_encrypt.c
lib_uadd32x64.c
lib_uadd64.c
lib_umul32.c
lib_umul32x64.c
lib_umul64.c
lib_usub64.c
lib_usub64x32.c
lib_utsname.c Fixes for compilation of stm32f746g-disco 2017-08-01 06:50:53 -06:00
lib_xorshift128.c