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

0 = epoll_wait(_, _, _, 0) loop takes 100% cpu #7

Closed
thypon opened this issue May 27, 2015 · 5 comments
Closed

0 = epoll_wait(_, _, _, 0) loop takes 100% cpu #7

thypon opened this issue May 27, 2015 · 5 comments

Comments

@thypon
Copy link

thypon commented May 27, 2015

After ndhc initialization, for loop inside ndhc.c starts getting CPU hungry. It takes 100% CPU not doing anything usefull besides epoll_wait with 0 timeout.

I uploaded a truncated strace even if ndhc continues with epoll_wait with 0 timeout.

http://dpaste.com/1TA8Z64

@niklata
Copy link
Owner

niklata commented May 27, 2015

Thanks for the report! Something unexpected is happening with the ARP or DHCP timeouts. Please apply the following debug patch and provide a sample of some of the prints:

http://dpaste.com/3S3JX3K

@niklata
Copy link
Owner

niklata commented May 27, 2015

I've just pushed a commit that adds a failsafe to prevent the rapid-busy spin (it will force ndhc to wake up every 10s instead).

I'd still be very interested in the output from the debugging patch I posted in the previous comment, as I'd like to correct any issue that may have caused the bad behavior you've encountered.

@thypon
Copy link
Author

thypon commented May 27, 2015

Thanks!

http://dpaste.com/362SXWS

@niklata
Copy link
Owner

niklata commented May 27, 2015

I think these problems are being caused by the long lease time on your network (which is perfectly valid -- it's an issue in ndhc).

I've pushed some commits that should clean up some possible truncation/overflow issues related to time values being represented as long long or unsigned long long being truncated down to epoll_wait's int-sized timeout.

Please let me know if the current ndhc master still has the problem. Thank you for the strace and debug print trace; they've been very helpful!

@thypon
Copy link
Author

thypon commented May 28, 2015

It's working with the latest version. Thank you.

@thypon thypon closed this as completed May 28, 2015
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

No branches or pull requests

2 participants