History log of /freebsd-current/sys/kern/sys_timerfd.c
Revision Date Author Comments
# 0ecf0b26 06-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

timerfd_create: fix after cf742faa39a58a9b43b671c66097e6880459d4ae

Remove the include that crept in by accident
Clang complains about CLOCK_BOOTTIME being the same for now as
CLOCK_UPTIME, so remove CLOCK_BOOTTIME and leave a comment for
what to do when CLOCK_BOOTTIME will be different for real.


# cf742faa 06-Mar-2024 Baptiste Daroussin <bapt@FreeBSD.org>

timerfd_create: accept CLOCK_UPTIME/CLOCK_BOOTTIME

This is a common use case when using timerfd_create to actually use
it with CLOCK_BOOTTIME on linux which is CLOCK_UPTIME for us.

Note that currently on freebsd CLOCK_BOOTTIME is CLOCK_UPTIME, but the
semantic is supposed to be different, this has to be fixed later.

Tested with the fnott notification software

Reviewed by: des, imp
Differential Revision: https://reviews.freebsd.org/D44253


# 18cb4223 31-Jan-2024 John Baldwin <jhb@FreeBSD.org>

timerfd: Move kern_timerfd_* prototypes to <sys/syscallsubr.h>


# f28526e9 19-Jan-2024 Konstantin Belousov <kib@FreeBSD.org>

kcmp(2): implement for generic file types

Reviewed by: brooks, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43518


# 918966a2 05-Sep-2023 Jake Freeland <jfree@FreeBSD.org>

timerfd: Relocate 32-bit compat code

32-bit compatibility code is conventionally stored in
sys/compat/freebsd32. Move freebsd32_timerfd_gettime() and
freebsd32_timerfd_settime() from sys/kern/sys_timerfd.c to
sys/compat/freebsd32/freebsd32_misc.c.

MFC After: 3 days
Reviewed by: imp, markj
Differential Revision; https://reviews.freebsd.org/D41640


# a1f50615 05-Sep-2023 Jake Freeland <jfree@FreeBSD.org>

timerfd: Define a locking regime

Define a locking regime for the members of struct timerfd and document
it so future code can follow the standard. The lock legend can be found
in a comment above struct timerfd.

Additionally,
* Add assertions based on locking regime.
* Fill kn_data with the expiration count when EVFILT_READ is triggered.
* Report st_ctim for stat(2).
* Check if file has f_type == DTYPE_TIMERFD before assigning timerfd
pointer to f_data.

MFC After: 3 days
Reviewed by: imp, kib, markj
Differential Revision: https://reviews.freebsd.org/D41600


# f4296cfb 02-Sep-2023 Mateusz Guzik <mjg@FreeBSD.org>

timerfd: convert timerfd_list_lock from sx to mtx

There was no good reason to use the former. This should prevent some
head-scratching by an interested and qualified reader.


# 5eab5230 25-Aug-2023 Mateusz Guzik <mjg@FreeBSD.org>

timerfd: compute fflags before calling falloc

While here dodge list locking in timerfd_adjust if empty.


# 02f534b5 25-Aug-2023 Mateusz Guzik <mjg@FreeBSD.org>

timerfd: fix up a memory leak and missing locking

timerfd01 from ltp passes (and some other don't), but none of the tests
crash the kernel.

This is a bare minimum patch to fix up the immediate regression.

Reported by: yasu


# af93fea7 23-Aug-2023 Jake Freeland <jfree@freebsd.org>

timerfd: Move implementation from linux compat to sys/kern

Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459