Skip to content

Commit 7ff7f6e

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
wdog: optimize a bit speed in wd_start
After these wdog refactor: We conducted a latency measurement using the rt-tests/cyclictest (commit cadd661) on an x86_64 NUC12 equipped with an i7-1255U processor and 16GB of LPDDR5 memory. The specific command used for this microbenchmark was cyclictest -q -l 100000 -h 30000, which is designed to assess the responsiveness of the cyclic timer. The findings from our benchmark are summarized below, highlighting the minimum, median, and maximum latency values for each operating system tested: Operating System Minimum Latency (us) Median Latency (us) Maximum Latency (us) Linux 48 53 410 PreemptRT 6 57 148 Xenomai 53 53 64 NuttX 64 626 1212 NuttX (refactor) 1 1 3 In this table, "Min" indicates the shortest latency observed, "Median" represents the middle value of the latency distribution, and "Max" denotes the longest latency encountered. The systems tested were as follows: Linux: ACRN version 6.1.80 (commit f528146) PreemptRT: Linux kernel 5.4.251 with the 5.4.254-rt85 patch applied Xenomai: Linux kernel 5.4.251 patched with ipipe-core-5.4.239-x86-13 These results clearly demonstrate the varying performance of different operating systems in terms of timer latency, the refactored NuttX showing particularly low latency values. Signed-off-by: ligd <[email protected]>
1 parent cb5bab3 commit 7ff7f6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sched/wdog/wd_start.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ void wd_insert(FAR struct wdog_s *wdog, clock_t expired,
178178
{
179179
FAR struct wdog_s *curr;
180180

181-
DEBUGASSERT(wdog && wdentry);
182-
183181
/* Traverse the watchdog list */
184182

185183
list_for_every_entry(&g_wdactivelist, curr, struct wdog_s, node)
@@ -295,8 +293,8 @@ int wd_start_absolute(FAR struct wdog_s *wdog, clock_t ticks,
295293

296294
wd_insert(wdog, ticks, wdentry, arg);
297295

298-
reassess |= list_is_head(&g_wdactivelist, &wdog->node);
299-
if (!g_wdtimernested && reassess)
296+
if (!g_wdtimernested &&
297+
(reassess || list_is_head(&g_wdactivelist, &wdog->node)))
300298
{
301299
/* Resume the interval timer that will generate the next
302300
* interval event. If the timer at the head of the list changed,

0 commit comments

Comments
 (0)