The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Mike Schanne <mschanne@kns.com>,
	Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-rt-devel@lists.linux.dev" <linux-rt-devel@lists.linux.dev>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	"chris.packham@alliedtelesis.co.nz"
	<chris.packham@alliedtelesis.co.nz>,
	Todd Leitzel <tleitzel@kns.com>
Subject: Re: [PATCH] uio: eliminate extraneous irq thread under CONFIG_PREEMPT_RT
Date: Wed, 19 Aug 2026 17:06:11 +0200	[thread overview]
Message-ID: <20260819150611.xWELTqJ-@linutronix.de> (raw)
In-Reply-To: <TY0PR0101MB48672132B8525B7B39565EE4D2A52@TY0PR0101MB4867.apcprd01.prod.exchangelabs.com>

Chris, what was the use case to split this?

On 2026-08-19 15:01:00 [+0000], Mike Schanne wrote:
> Commit f8a27dfa4b82d442af1c0645a5acc70cc97c67f6 ("uio: use threaded
> interrupts") makes all uio interrupts threaded by default.  However
> under CONFIG_PREEMPT_RT, all interrupts are already threaded.  This
> results in 2 irq threads per uio instance, adding an unnecessary
> extra context switch per interrupt.
> 
> Do not request a threaded interrupt for uio under CONFIG_PREEMPT_RT
> 
> Signed-off-by: Michael Schanne mschanne@kns.com<mailto:mschanne@kns.com>
> ---
> drivers/uio/uio.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index 004a549c6..4e28777ac 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -448,8 +448,12 @@ static irqreturn_t uio_interrupt_handler(int irq, void *dev_id)
>                irqreturn_t ret;
>                 ret = idev->info->handler(irq, idev->info);
> -              if (ret == IRQ_HANDLED)
> -                              ret = IRQ_WAKE_THREAD;
> +             if (ret == IRQ_HANDLED) {
> +                             if (IS_ENABLED(CONFIG_PREEMPT_RT))
> +                                             uio_event_notify(idev->info);
> +                             else
> +                                             ret = IRQ_WAKE_THREAD;
> +             }
>                 return ret;
> }
> @@ -1038,8 +1042,13 @@ int __uio_register_device(struct module *owner,
>                                 * FDs at the time of unregister and therefore may not be
>                                 * freed until they are released.
>                                 */
> -                              ret = request_threaded_irq(info->irq, uio_interrupt_handler, uio_interrupt_thread,
> -                                                                                 info->irq_flags, info->name, idev);
> +                             if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
> +                                             ret = request_irq(info->irq, uio_interrupt_handler,
> +                                                             info->irq_flags, info->name, idev);
> +                             } else {
> +                                             ret = request_threaded_irq(info->irq, uio_interrupt_handler, uio_interrupt_thread,
> +                                                             info->irq_flags, info->name, idev);
> +                             }
>                                if (ret) {
>                                                info->uio_dev = NULL;
>                                                goto err_request_irq;

Sebastian

       reply	other threads:[~2026-08-19 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <TY0PR0101MB48672132B8525B7B39565EE4D2A52@TY0PR0101MB4867.apcprd01.prod.exchangelabs.com>
2026-08-19 15:06 ` Sebastian Andrzej Siewior [this message]
2026-08-19 20:48   ` [PATCH] uio: eliminate extraneous irq thread under CONFIG_PREEMPT_RT Chris Packham
2026-08-20 14:12     ` Sebastian Andrzej Siewior
2026-08-25 12:44       ` Sebastian Andrzej Siewior
2026-08-19 15:06 Mike Schanne
2026-08-25 10:45 ` Ahmed S. Darwish

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=20260819150611.xWELTqJ-@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mschanne@kns.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tleitzel@kns.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