On Linux, read(2) timerfd returns an unsigned 8-byte integer (uint64_t) containing the number of expirations that have occurred, if the timer has already expired one or more times since its settings were last modified using timerfd_settime(), or since the last successful read(2).That's to say, once do a read or timerfd_settime operation, timer fd's expiration count should be zero.
Some Linux applications create timerfd and add it to epoll with LT mode, when event comes, they do timerfd_settime instead of read to stop event source from trigger, On FreeBSD timerfd_settime don't set count to zero, so cause CPU high.
Add set count to zero On FreeBSD emulation linux_timerfd_settime.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 36332 Build 33221: arc lint + arc unit
Event Timeline
Comment Actions
I don't have experience with that code, and neither with timerfd, but your patch makes sense. Can you tell me which apps use the behaviour you're describing?
Comment Actions
Sorry, according to the git-log record, I made this modification on March 30th 2020 for some Linux desktop related programs, but I did not record which program it was.
Comment Actions
Could you help me? I don't have permission to commit it.
I also have another review about timerfd ready to land
https://reviews.freebsd.org/D28148.
If possible please help me to commit it also, thank you.