Bug 252820 - Linuxulator: linux_timerfd_settime don't set expirations count to zero
Summary: Linuxulator: linux_timerfd_settime don't set expirations count to zero
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-19 06:44 UTC by shu
Modified: 2021-02-08 01:38 UTC (History)
2 users (show)

See Also:


Attachments
timerfd+epoll+LT (1.40 KB, text/plain)
2021-01-19 06:44 UTC, shu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description shu 2021-01-19 06:44:19 UTC
Created attachment 221726 [details]
timerfd+epoll+LT

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, code in the attachment, On FreeBSD timerfd_settime don't set count to zero, so cause CPU high.
Comment 1 shu 2021-01-19 06:51:11 UTC
https://reviews.freebsd.org/D28231
Comment 2 Ed Maste freebsd_committer 2021-02-08 01:38:53 UTC
Committed in ae71b794cbed