add epoll polling mode, improve latency performance in RTT mode #869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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