From: Thomas Gleixner <tglx@linutronix.de>
To: "Cédric Le Goater" <clg@kaod.org>, "Nicholas Piggin" <npiggin@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genirq: reduce irqdebug bouncing cachelines
Date: Mon, 12 Apr 2021 14:43:45 +0200 [thread overview]
Message-ID: <87wnt71xmm.ffs@nanos.tec.linutronix.de> (raw)
In-Reply-To: <2dae4501-6f01-1b32-4b69-1dfc94c93425@kaod.org>
Cédric,
On Mon, Apr 12 2021 at 11:06, Cédric Le Goater wrote:
> On 4/10/21 1:58 PM, Thomas Gleixner wrote:
>> --- a/kernel/irq/spurious.c
>> +++ b/kernel/irq/spurious.c
>> @@ -274,7 +274,7 @@ void note_interrupt(struct irq_desc *des
>> unsigned int irq;
>>
>> if (desc->istate & IRQS_POLL_INPROGRESS ||
>> - irq_settings_is_polled(desc))
>> + irq_settings_is_polled(desc) | irq_settings_no_debug(desc))
>
> Shouldn't it be '||' instead ?
It could. But that's intentionally '|'. Why?
Because that lets the compiler merge the bit checks into one and
therefore spares one conditional branch.
>> return;
>>
>> if (bad_action_ret(action_ret)) {
>>
>
> We could test irq_settings_no_debug() directly under handle_nested_irq()
> and handle_irq_event_percpu() to avoid calling note_interrupt(), just
> like we do for noirqdebug.
We can do that, but then we should not just make it:
if (!irqnodebug && !irq_settings_no_debug(desc))
note_interrupt(...);
Instead have only one condition:
if (!irq_settings_no_debug(desc))
note_interrupt(...);
See the uncompiled delta patch below.
Thanks,
tglx
---
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1690,6 +1690,9 @@ static int
irq_settings_set_no_debug(desc);
}
+ if (noirqdebug)
+ irq_settings_set_no_debug(desc);
+
if (new->flags & IRQF_ONESHOT)
desc->istate |= IRQS_ONESHOT;
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -274,7 +274,7 @@ void note_interrupt(struct irq_desc *des
unsigned int irq;
if (desc->istate & IRQS_POLL_INPROGRESS ||
- irq_settings_is_polled(desc) | irq_settings_no_debug(desc))
+ irq_settings_is_polled(desc))
return;
if (bad_action_ret(action_ret)) {
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -481,7 +481,7 @@ void handle_nested_irq(unsigned int irq)
for_each_action_of_desc(desc, action)
action_ret |= action->thread_fn(action->irq, action->dev_id);
- if (!noirqdebug)
+ if (!irq_settings_no_debug(desc))
note_interrupt(desc, action_ret);
raw_spin_lock_irq(&desc->lock);
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -197,7 +197,7 @@ irqreturn_t handle_irq_event_percpu(stru
add_interrupt_randomness(desc->irq_data.irq, flags);
- if (!noirqdebug)
+ if (!irq_settings_no_debug(desc))
note_interrupt(desc, retval);
return retval;
}
next prev parent reply other threads:[~2021-04-12 12:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-02 13:20 [PATCH] genirq: reduce irqdebug bouncing cachelines Nicholas Piggin
2021-04-10 11:38 ` [tip: irq/core] genirq: Reduce irqdebug cacheline bouncing tip-bot2 for Nicholas Piggin
2021-04-10 11:58 ` [PATCH] genirq: reduce irqdebug bouncing cachelines Thomas Gleixner
2021-04-12 9:06 ` Cédric Le Goater
2021-04-12 12:43 ` Thomas Gleixner [this message]
2021-04-13 12:16 ` Cédric Le Goater
2021-04-13 20:24 ` Thomas Gleixner
2021-04-14 13:13 ` Cédric Le Goater
2021-05-15 17:01 ` Cédric Le Goater
2021-05-17 18:04 ` [tip: irq/core] genirq: Add a IRQF_NO_DEBUG flag tip-bot2 for Thomas Gleixner
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=87wnt71xmm.ffs@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=clg@kaod.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@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;
as well as URLs for NNTP newsgroup(s).