Merged in masayuki2009/nuttx.nuttx/lc823450_smp_test (pull request #601)

lc823450 smp test

* sched/clock: Replace critical section APIs with spin lock APIs in clock_gettime.c

    This change will improve performance for SMP systems but nothing
    changes for non-SMP systems. (Pls see include/nuttx/irq.h)

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

* sched/sched: Remove unnecessary DEBUGASSERT in sched_removereadytorun.c

    In SMP mode, rtrtcb is not always at the g_readytorun.head.
    This change removes DEBUGASSERT() to avoid this condition.

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2018-02-15 14:18:25 +00:00 committed by Gregory Nutt
parent 75f68b9d3a
commit 7062ca2c03
2 changed files with 4 additions and 6 deletions

View File

@ -110,12 +110,12 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
* CLOCK_MONOTONIC be introduced additional increases to systime.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave();
tp->tv_sec += (uint32_t)g_monotonic_basetime.tv_sec;
tp->tv_nsec += (uint32_t)g_monotonic_basetime.tv_nsec;
leave_critical_section(flags);
spin_unlock_irqrestore(flags);
/* Handle carry to seconds. */
@ -163,12 +163,12 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
* was last set, this gives us the current time.
*/
flags = enter_critical_section();
flags = spin_lock_irqsave();
ts.tv_sec += (uint32_t)g_basetime.tv_sec;
ts.tv_nsec += (uint32_t)g_basetime.tv_nsec;
leave_critical_section(flags);
spin_unlock_irqrestore(flags);
/* Handle carry to seconds. */

View File

@ -238,8 +238,6 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb)
tmptcb = (FAR struct tcb_s *)
dq_remfirst((FAR dq_queue_t *)&g_readytorun);
DEBUGASSERT(tmptcb == rtrtcb);
dq_addfirst((FAR dq_entry_t *)tmptcb, tasklist);
tmptcb->cpu = cpu;