From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Brandt, Oliver - Lenze" <oliver.brandt@lenze.com>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
"peterz@infradead.org" <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] irq_work: Avoid unnecessary "IRQ work" interrupts
Date: Wed, 28 Aug 2024 11:37:19 +0200 [thread overview]
Message-ID: <20240828093719.3KJWbR6Y@linutronix.de> (raw)
In-Reply-To: <25833c44051f02ea2fd95309652628e2b1607a1e.camel@lenze.com>
On 2024-08-27 15:45:42 [+0000], Brandt, Oliver - Lenze wrote:
> It was noticed that newer kernels (>= 6.1) raises a lot of "IRQ work"
> interrupts where older ones (<= 5.10) haven't used this at all on our
> system.
>
> Root cause seems to be commit b4c6f86ec2f6 ('irq_work: Handle some
> irq_work in a per-CPU thread on PREEMPT_RT'). This commit tries to avoid
> calling irq_work callbacks from hardirq context as much as possible.
> Therefore interrupts marked as IRQ_WORK_LAZY and (on PREEMT_RT) interrupts
> not marked as IRQ_WORK_HARD_IRQ should be handled from an per-CPU thread.
>
> Running the remaining interrupts from hardirq context is triggered using
> irq_work_raise(). But on PREEMPT_RT irq_work_raise() will be called for
> all interrupts not marked as IRQ_WORK_LAZY which results in unnecessary
> "IRQ work" interrupts.
Good catch I think.
> Fixes: b4c6f86ec2f6 ('irq_work: Handle some irq_work in a per-CPU thread on PREEMPT_RT')
> Signed-off-by: Oliver Brandt <oliver.brandt@lenze.com>
> ---
> kernel/irq_work.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> index 2f4fb336dda1..df08b7dde7d5 100644
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -108,7 +108,7 @@ static void __irq_work_queue_local(struct irq_work *work)
> return;
>
> /* If the work is "lazy", handle it from next tick if any */
> - if (!lazy_work || tick_nohz_tick_stopped())
> + if (!(lazy_work || rt_lazy_work) || tick_nohz_tick_stopped())
> irq_work_raise(work);
Looking at this I *think* rt_lazy_work was needed earlier due to
different code but not anymore. Couldn't you just remove rt_lazy_work
and set lazy_work in the RT path? That should work.
> }
>
Sebastian
next prev parent reply other threads:[~2024-08-28 9:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 15:45 [PATCH] irq_work: Avoid unnecessary "IRQ work" interrupts Brandt, Oliver - Lenze
2024-08-28 9:37 ` Sebastian Andrzej Siewior [this message]
2024-08-28 9:54 ` Sebastian Andrzej Siewior
2024-08-28 13:26 ` Brandt, Oliver - Lenze
2024-08-28 14:02 ` bigeasy
2024-08-28 14:52 ` Brandt, Oliver - Lenze
2024-09-03 9:26 ` bigeasy
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=20240828093719.3KJWbR6Y@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.brandt@lenze.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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