Page MenuHomeFreeBSD

linux_timerfd_settime set expirations count to zero
ClosedPublic

Authored by ankohuu_outlook.com on Jan 19 2021, 6:48 AM.
Tags
None
Referenced Files
F97606251: D28231.diff
Mon, Sep 30, 8:04 AM
Unknown Object (File)
Sun, Sep 29, 4:01 AM
Unknown Object (File)
Sat, Sep 28, 9:27 AM
Unknown Object (File)
Wed, Sep 25, 6:54 PM
Unknown Object (File)
Sun, Sep 22, 7:17 PM
Unknown Object (File)
Fri, Sep 20, 10:26 PM
Unknown Object (File)
Fri, Sep 20, 8:12 AM
Unknown Object (File)
Mon, Sep 16, 4:47 PM

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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?

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?

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.

Thanks! Can you commit it yourself, or should I?

Thanks! Can you commit it yourself, or should I?

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.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2021, 7:09 PM
This revision was automatically updated to reflect the committed changes.

Done. Thank you, and let me know when you have any more linuxulator fixes :-)