From: Pavel Begunkov <asml.silence@gmail.com>
To: Maoyi Xie <maoyixie.tju@gmail.com>, Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] io_uring: honour submitter's time namespace for ABS timeouts
Date: Wed, 6 May 2026 10:05:42 +0100 [thread overview]
Message-ID: <c2d26c6e-c064-4e6d-a1e2-69e84b867ba8@gmail.com> (raw)
In-Reply-To: <20260504153755.1293932-1-maoyi.xie@ntu.edu.sg>
On 5/4/26 16:37, Maoyi Xie wrote:
> This series addresses two io_uring code paths that arm an ABS
> hrtimer from a timestamp supplied by the caller. Both paths skip
> the conversion from the submitter's time namespace view to host
> view via timens_ktime_to_host(). The clock is CLOCK_MONOTONIC by
> default, or optionally CLOCK_BOOTTIME.
>
> All four other ABS timer interfaces already do this conversion:
> timer_settime(TIMER_ABSTIME), clock_nanosleep(TIMER_ABSTIME),
> alarm_timer_nsleep(TIMER_ABSTIME), and
> timerfd_settime(TFD_TIMER_ABSTIME).
>
> Patch 1/2 (io_uring/timeout) covers IORING_OP_TIMEOUT and
> IORING_OP_LINK_TIMEOUT via io_parse_user_time(). It is essentially
> the draft Pavel posted on the original thread. I rebased it on
> io_uring-7.1 and verified end to end.
>
> Patch 2/2 (io_uring/wait) covers the IORING_ENTER_ABS_TIMER path
> in io_uring_enter(). That path parses ext_arg->ts inline rather
> than going through io_parse_user_time(). Patch 1/2 therefore does
> not cover it.
>
> Per Pavel and Jens's discussion on the original thread, the two
> sites use two direct timens_ktime_to_host() call sites rather
> than a shared helper. Patch 1/2 also splits the existing
> io_timeout_get_clock() into a flags only io_flags_to_clock(), so
> io_parse_user_time() can resolve the clock without a
> struct io_timeout_data.
>
> SQPOLL is automatically covered. The SQPOLL kernel thread is
> created via create_io_thread() with CLONE_THREAD and no CLONE_NEW*
> flag. copy_namespaces() therefore shares the submitter's nsproxy
> by reference. timens_ktime_to_host() through "current" sees the
> submitter's time_ns when called from the SQPOLL kthread. PoCs for
> both paths confirm this.
At a quick glance, both look good. I think you had an isolated
reproducer, are you sending it as a liburing test? Would be
greatly appreciated.
--
Pavel Begunkov
next prev parent reply other threads:[~2026-05-06 9:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 15:37 [PATCH 0/2] io_uring: honour submitter's time namespace for ABS timeouts Maoyi Xie
2026-05-04 15:37 ` [PATCH 1/2] io_uring/timeout: honour caller's time namespace for IORING_TIMEOUT_ABS Maoyi Xie
2026-05-04 15:37 ` [PATCH 2/2] io_uring/wait: honour caller's time namespace for IORING_ENTER_ABS_TIMER Maoyi Xie
2026-05-06 9:05 ` Pavel Begunkov [this message]
2026-05-06 11:01 ` [PATCH 0/2] io_uring: honour submitter's time namespace for ABS timeouts Maoyi Xie
2026-05-06 11:01 ` Jens Axboe
2026-05-06 11:01 ` Jens Axboe
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=c2d26c6e-c064-4e6d-a1e2-69e84b867ba8@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maoyixie.tju@gmail.com \
/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