mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gowans, James" <jgowans@amazon.com>
To: "maz@kernel.org" <maz@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"liaochang1@huawei.com" <liaochang1@huawei.com>
Cc: "zouyipeng@huawei.com" <zouyipeng@huawei.com>,
	"Raslan, KarimAllah" <karahmed@amazon.com>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Sironi, Filippo" <sironi@amazon.de>,
	"chris.zjh@huawei.com" <chris.zjh@huawei.com>
Subject: Re: [PATCH] irq: fasteoi handler re-runs on concurrent invoke
Date: Tue, 30 May 2023 21:47:57 +0000	[thread overview]
Message-ID: <f9cb8c3f546cf9aa6422e478ec56422b92264c8c.camel@amazon.com> (raw)
In-Reply-To: <516b8316-fba9-f3d9-2b3a-2536bd747a69@huawei.com>

On Mon, 2023-05-29 at 10:47 +0800, Liao, Chang wrote:
> 
> > 
> > Wording may need a slight tweak, especially pointing out why PENDING is
> > set.
> 
> Sure, see the comment below:
> 
> "Ack another interrupt from the same source can occurs on new CPU even before
> the first one is handled on original CPU, IRQS_PENDING bit can be reused to
> indicate this situation, which will defer the execution of the interrupt handler
> function associated with the irq_desc until the first interrupt handler returns."
> 
> In summary, the IRQ_PENDINGS ensures that only one interrupt handler is ever
> running for a particular source at a time, and the major usages of IRQS_PENDING
> in kernel as follows:
> 
> 1. Used in irq flow handler to indicate that an acknowledged interrupt cannot be
> handled immediately due to three different reasons:
> - Case1: the interrupt handler function has been unregistered via free_irq().
> - Case2: the interrupt has been disabled via irq_disable().
> - Case3: the interrupt is an edge-triggered interrupt and its handler is already
>          running on the CPU.
> 
> In any of these cases, the kernel will defer the execution of the interrupt handler
> until the interrupt is enabled and new handler is established again via check_irq_resend(),
> or via the inside loop in handle_edge_irq() upon the previous handler returns.
> 
> 2. Used in the spurious interrupt detector, a few systems with misdescribed IRQ
> routing can cause an interrupt to be handled on the wrong CPU. In this situation,
> the spurious interrupt detector searches for a recovery handler for the interrupt.
> If the found handler is running on another CPU, the spurious interrupt detector
> also defers the execution of the recovery handler, similar to case 3 in #1.
> 
> I hope this is helpful.

Stunning! I tried to pillage some of this for the commit message, but I
think it was too much detail for this commit message - it probably belongs
in a doc or code comment somewhere though. Useful!

> > If you want I'm happy to make these tweaks and post as V2?
> > There are also some other comments I'm keen to add to the flag enums to
> > make it a bit clearer what some of the flags mean.
> 
> Don't see why not :)

Done, V2: https://lore.kernel.org/lkml/20230530213848.3273006-2-jgowans@amazon.com/

JG

  reply	other threads:[~2023-05-30 21:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17  9:53 James Gowans
2023-03-17 10:12 ` Yipeng Zou
2023-03-17 11:49   ` Gowans, James
2023-03-22  6:26     ` Yipeng Zou
2023-03-22  7:48       ` Gowans, James
2023-03-22 10:37         ` Thomas Gleixner
2023-04-03 13:17           ` zhangjianhua (E)
2023-04-03 13:19             ` Marc Zyngier
2023-04-03 13:39               ` Gowans, James
2023-03-22 10:38         ` Yipeng Zou
2023-04-09 11:41 ` Marc Zyngier
2023-04-11 10:27   ` Gowans, James
2023-04-12 13:32     ` Marc Zyngier
2023-04-18  2:39       ` Yipeng Zou
2023-04-18 10:56       ` Gowans, James
2023-04-19  3:08         ` Yipeng Zou
2023-05-02  8:43         ` Gowans, James
2023-05-23  3:16           ` liaochang (A)
2023-05-25 10:04             ` Gowans, James
2023-05-29  2:47               ` Liao, Chang
2023-05-30 21:47                 ` Gowans, James [this message]
     [not found]           ` <86sfcfghqh.wl-maz@kernel.org>
2023-05-23 12:47             ` Gowans, James
2023-05-25 12:31               ` Liao, Chang
2023-05-02 10:28         ` Marc Zyngier
2023-05-23  3:16       ` liaochang (A)
2023-05-23  3:15 ` liaochang (A)
2023-05-23 11:59   ` Gowans, James
2023-05-25 12:31     ` Liao, Chang

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=f9cb8c3f546cf9aa6422e478ec56422b92264c8c.camel@amazon.com \
    --to=jgowans@amazon.com \
    --cc=chris.zjh@huawei.com \
    --cc=dwmw@amazon.co.uk \
    --cc=karahmed@amazon.com \
    --cc=liaochang1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=sironi@amazon.de \
    --cc=tglx@linutronix.de \
    --cc=zouyipeng@huawei.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

all inboxes | Powered by JetHome®