Re: [PATCH] io_uring/wait: wake real-time waiters from hard interrupt context
From: Sebastian Andrzej Siewior
Date: Sat Oct 17 2026 - 11:20:02 EST
On 2026-10-16 18:33:03 [-0700], Austin Schuh wrote:
> --- a/io_uring/wait.c
> +++ b/io_uring/wait.c
> @@ -120,23 +121,39 @@ static enum hrtimer_restart io_cqring_min_timer_wakeup(struct hrtimer *timer)
> return io_cqring_timer_wakeup(timer);
> }
>
> +/*
> + * On PREEMPT_RT, hrtimers not marked for hard interrupt expiry expire in the
> + * ktimers thread, at the lowest real-time priority, so a real-time waiter
> + * isn't woken until every runnable real-time task on its CPU has blocked.
> + * Like hrtimer sleepers (see __hrtimer_setup_sleeper()), expire the timer in
> + * hard interrupt context if the waiter is a real-time task. Both callbacks
> + * only look at the ring and wake the task, which is safe there.
Please simply refer to __hrtimer_setup_sleeper() for the policy.
> + */
> +static enum hrtimer_mode io_cqring_timer_mode(void)
> +{
> + if (IS_ENABLED(CONFIG_PREEMPT_RT) && rt_or_dl_task_policy(current))
> + return HRTIMER_MODE_ABS_HARD;
> + return HRTIMER_MODE_ABS;
> +}
Sebastian