Skip to content

Conversation

@liujinhui-job
Copy link
Contributor

@liujinhui-job liujinhui-job commented Mar 19, 2025

NOTICE:In the following data, sem_wait block mode, when the timeout > 0 or timeout < 0, the RTT latency performance is poor. After reviewing the code implementation, I found the main issue lies in the flawed sem_flag logic within the ff_sys_epoll_wait function. This defect causes both sem_wait and sem_timedwait to essentially fail their intended functions, which instead of helping, is actually degrading system performance. I will address this by submitting a code fix in the next commit to correct the semaphore handling logic.

Add epoll polling mode, improve latency performance in RTT mode.
The test results after modification are as follows:
i5-12400 4.4Ghz TSC 2.5Ghz
RTT测试
epoll_wait(polling mode)
timeout = 0
32字节 7822时钟周期 3.128us
1400字节 9684时钟周期 3.873us
timeout = -1
32字节 7398时钟周期 2.959us
1400字节 9478时钟周期 3.791us
timeout = 1000
32字节 7395时钟周期 2.958us
1400字节 9524时钟周期 3.809us

epoll_wait(sem_wait block mode)
timeout = 0
32字节 12674时钟周期 5.069us
1400字节 15000时钟周期 6us
timeout = -1
32字节 18764时钟周期 7.505us
1400字节 20408时钟周期 8.163us
timeout = 1000
32字节 17474时钟周期 6.989us
1400字节 20113时钟周期 8.045us

@jfb8856606 jfb8856606 merged commit f98fb46 into F-Stack:dev Mar 27, 2025
1 check passed
@liujinhui-job liujinhui-job deleted the add-epoll-polling-mode branch June 8, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants