[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251023090438.GX3245006@noisy.programming.kicks-ass.net>
Date: Thu, 23 Oct 2025 11:04:38 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Michael Jeanson <mjeanson@...icios.com>,
Jens Axboe <axboe@...nel.dk>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E. McKenney" <paulmck@...nel.org>, x86@...nel.org,
Sean Christopherson <seanjc@...gle.com>,
Wei Liu <wei.liu@...nel.org>
Subject: Re: [patch V5 28/31] rseq: Switch to fast path processing on exit to
user
On Wed, Oct 22, 2025 at 02:52:35PM +0200, Thomas Gleixner wrote:
> +static __always_inline unsigned long __exit_to_user_mode_loop(struct pt_regs *regs,
> + unsigned long ti_work)
> {
> /*
> * Before returning to user space ensure that all pending work
> @@ -62,6 +57,23 @@ void __weak arch_do_signal_or_restart(st
> return ti_work;
> }
>
> +/**
> + * exit_to_user_mode_loop - do any pending work before leaving to user space
> + * @regs: Pointer to pt_regs on entry stack
> + * @ti_work: TIF work flags as read by the caller
> + */
> +__always_inline unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
> + unsigned long ti_work)
> +{
> + for (;;) {
> + ti_work = __exit_to_user_mode_loop(regs, ti_work);
> +
> + if (likely(!rseq_exit_to_user_mode_restart(regs)))
> + return ti_work;
> + ti_work = read_thread_flags();
> + }
> +}
Loops in loops seems to be your favourite new theme :-)
Powered by blists - more mailing lists