public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	kernel-team@meta.com
Subject: [PATCH] timerfd: Support CLOCK_TAI
Date: Thu, 19 Mar 2026 14:10:22 +0800	[thread overview]
Message-ID: <abuTTv9FC__H_8RC@chrisdown.name> (raw)

Despite hrtimer and POSIX timers both accepting CLOCK_TAI,
timerfd_create() rejects it. This usually corners userspace into one of
two bad options:

1. Convert TAI deadlines through CLOCK_REALTIME, which reintroduces the
   leap second exposure the application was trying to avoid in the first
   place.
2. Abandon timerfd entirely and use POSIX timers or busy wait approaches
   that do not compose well with epoll based event loops.

Avoid these bad outcomes by allowing timerfd to support CLOCK_TAI. The
underlying hrtimer and k_clock infrastructure already supports this.

With this, epoll based applications can arm TAI based file descriptor
timers natively.

Signed-off-by: Chris Down <chris@chrisdown.name>
---
 fs/timerfd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index 73104f36bcae..278ad4ab65c8 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -404,6 +404,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
 	    (clockid != CLOCK_MONOTONIC &&
 	     clockid != CLOCK_REALTIME &&
 	     clockid != CLOCK_REALTIME_ALARM &&
+	     clockid != CLOCK_TAI &&
 	     clockid != CLOCK_BOOTTIME &&
 	     clockid != CLOCK_BOOTTIME_ALARM))
 		return -EINVAL;

base-commit: a989fde763f4f24209e4702f50a45be572340e68
-- 
2.53.0


             reply	other threads:[~2026-03-19  6:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  6:10 Chris Down [this message]
2026-03-19  9:05 ` [PATCH] timerfd: Support CLOCK_TAI Chris Down
2026-03-20 17:36   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abuTTv9FC__H_8RC@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=anna-maria@linutronix.de \
    --cc=brauner@kernel.org \
    --cc=frederic@kernel.org \
    --cc=jack@suse.cz \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox