asterinas / asterinas

Asterinas is a secure, fast, and general-purpose OS kernel, written in Rust and providing Linux-compatible ABI.
https://asterinas.github.io/
Other
837 stars 86 forks source link

Schedule task periodically #1131

Closed sdww0 closed 4 weeks ago

sdww0 commented 1 month ago

I'm not sure if this is a feature request or a bug, but I'm certain that it is a problem. Therefore, I'm creating a blank issue instead. Here is the problem I discovered:

Problem

The lat_unix_connect in LMbench will result in a connection refused error when running in Asterinas with LOG_LEVEL=error. However, it works well with LOG_LEVEL=debug. Then I found that the problem was that the server process failed to call the 'accept' syscall in time, causing the size of 'incoming_endpoints' in 'Backlog' to reach the 'backlog'.

Quick fix

After registering a timer callback function that calls schedule periodically with a 50ms frequency. The issue was resolved, and I received the results in about 1.8 microseconds.

junyang-zh commented 1 month ago

990 should fix the problem