Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsock: Fix CPU util 100% in vhost-device-vsock #805

Closed
wants to merge 1 commit into from

Conversation

DarcySail
Copy link

When communicating with kata-agent (and other sample code) using vhost-device-vsock, the default EPOLLLT mode causes the process to continuously attempt to read from the socket. This results in the vhost-device-vsock process
reaching a CPU utilization of 100%.

Signed-off-by: SU Hang [email protected]

When communicating with kata-agent (and other sample code)
using vhost-device-vsock, the default EPOLLLT mode causes
the process to continuously attempt to write to the socket,
as long as the buffer is available, even though there is no
data to be sent.
This results in the vhost-device-vsock process
reaching a CPU utilization of 100%.

Signed-off-by: SU Hang <[email protected]>
@DarcySail DarcySail force-pushed the dali-fix-vsock-cpu-100 branch from 2588b27 to 717fd60 Compare February 6, 2025 08:11
@justxuewei
Copy link
Contributor

Hi @stefano-garzarella, could I get some eyes on this?

@stefano-garzarella
Copy link
Member

Last week we merged #800 that fixed an issue quite similar, can you check if your issue is already fixed with that? (current main contains the fix)

Also, I think edge triggering is tricky, so I would ask you to better explain why you think it is wrong to use the default mode and especially to put comments in the code, because new features might assume that we use epoll in the standard way.

I'm not a big fan of edge triggering, so I would prefer a different approach. If really required, I'd like a better analysis of the problem and an explanation of why edge triggering is the solution.

@justxuewei
Copy link
Contributor

Yes, we are fixing the same issue and I think it might be fixed by the PR you mentioned. (We just cloned the code a couple of weeks ago when the patch hadn't been merged yet) Thanks a lot!

@stefano-garzarella
Copy link
Member

I see, please close this PR if the issue is fixed!

@DarcySail @justxuewei thanks for the report and the PR!

@DarcySail
Copy link
Author

Thanks for the review;-)

@DarcySail DarcySail closed this Feb 11, 2025
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.

3 participants