Page MenuHomeFreeBSD

kevent(2): wrong EVFILT_TIMER timeouts when using NOTE_NSECONDS
ClosedPublic

Authored by gbe on Jan 9 2021, 5:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 6:03 PM
Unknown Object (File)
Feb 24 2024, 5:47 AM
Unknown Object (File)
Feb 18 2024, 3:08 PM
Unknown Object (File)
Jan 14 2024, 6:55 PM
Unknown Object (File)
Jan 3 2024, 8:12 AM
Unknown Object (File)
Dec 20 2023, 4:37 AM
Unknown Object (File)
Dec 14 2023, 10:04 PM
Unknown Object (File)
Dec 2 2023, 5:45 AM
Subscribers

Details

Summary

kevent(2): wrong EVFILT_TIMER timeouts when using NOTE_NSECONDS

From the PR: There is a typo in "timer2sbintime" (sys/kern/kern_event.c) when converting NOTE_NSECONDS to sbintime_t. For the nanosecond part US_TO_SBT instead of NS_TO_SBT is used. This results in weird timeout values.

PR: 252539
Submitted by: Jan Kokemüller <jan dot kokemueller at gmail dot com>

Test Plan

buildworld and a kyua test run

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36064
Build 32953: arc lint + arc unit

Event Timeline

gbe requested review of this revision.Jan 9 2021, 5:42 PM

We should also incorporate Jan's reproducer into the test suite, but I can do this after the fact.

Note that the "Submitted by" could be dropped if you recommit locally with git commit --author="Jan Kokemüller <jan.kokemueller@gmail.com>". I haven't seen any particular guidance one way or the other, but IMO the commit metadata attribution is more aesthetically pleasing.

This revision is now accepted and ready to land.Jan 9 2021, 5:47 PM

We should also incorporate Jan's reproducer into the test suite, but I can do this after the fact.

Note that the "Submitted by" could be dropped if you recommit locally with git commit --author="Jan Kokemüller <jan.kokemueller@gmail.com>". I haven't seen any particular guidance one way or the other, but IMO the commit metadata attribution is more aesthetically pleasing.

I'll do it once I commit the patch to main. Does your approval implies an "approved by: kevans"? ;-)

What could be done there, besides tests, is assert that e.g. converting SBT to NS (sbttons()) gives the original value. Or may be this is too naive, it should be orig value within some epsilon.