mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eugen Hristev <ehristev@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: "Bjorn Helgaas" <helgaas@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: iproc-msi: Bound events handled per IRQ
Date: Wed, 4 Nov 2026 21:58:13 +0200	[thread overview]
Message-ID: <de273977-8e8d-410e-8424-e99a0b4080b7@kernel.org> (raw)
In-Reply-To: <179338093960.40615.2809022600772649565.b4-reply@b4>

On 10/30/26 19:22, Manivannan Sadhasivam wrote:
> On 2026-10-16 23:10 +0300, Eugen Hristev wrote:
>> On 10/16/26 21:21, Bjorn Helgaas wrote:
>>> On Fri, Oct 16, 2026 at 03:18:53PM +0300, Eugen Hristev wrote:
>>>> Limit each iProc MSI parent IRQ to 16 event-queue entries.
>>>>
>>>> A continuously fed queue could otherwise keep the chained handler running
>>>> and starve other work. The budget still drains pending events and lets the
>>>> next parent interrupt continue processing, improving fairness and bounding
>>>> interrupt-handler latency.
>>>>
>>>> Without this starvation avoidance, one CPU can stall indefinitely
>>>> in the loop and not serve other interrupts, timers, etc.
>>>>
>>>> While testing it with an Ethernet NIC,  when too many MSI interrupts
>>>> come in, CPU might get starved:
>>>>
>>>> Connecting to host 192.168.30.1, port 5201
>>>> [  5] local 192.168.30.2 port 52586 connected to 192.168.30.1 port 5201
>>>> [ ID] Interval           Transfer     Bitrate         Retr  Cwnd
>>>> [  5]   0.00-1.00   sec   240 MBytes  2.01 Gbits/sec    2    334 KBytes
>>>> [  5]   1.00-2.00   sec  63.2 MBytes   531 Mbits/sec    1   1.41 KBytes
>>>> [  5]   2.00-3.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  5]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes
>>>> [  177.568497] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
>>>> [  177.568913] rcu:     0-...!: (1 GPs behind) idle=28ac/1/0x4000000000000002 softirq=28922/28930 fqs=1
>>>> [  177.569457] rcu:     (detected by 1, t=5256 jiffies, g=21629, q=819 ncpus=4)
>>>> [  177.569870] Sending NMI from CPU 1 to CPUs 0:
>>>>
>>>> With this bounded approach, IRQ handler will complete and continue
>>>> to serve MSI events on the next handler invocation.
>>>
>>> Is there something unique about iproc that makes this an issue, or do
>>> we need to worry about this in every MSI interrupt handler?
>>>
>> This is not specific to iPROC, so in theory it can happen to any other
>> MSI interrupt handler. If the handler has no way to break the loop, and
>> the condition that generates the MSI IRQ happens continuously, the same
>> situation will happen.
> 
>> Some other drivers e.g. take the IRQ state into a local variable, do the
>> task, clear it up, and don't care to read it again, like the iPROC is
>> doing, unless another MSI fires.
>>
> 
> You should rework the iproc handler to read head and tail outside of the loop
> and handle the recorded events inside the loop. This will avoid using any
> arbitrary max event limit and allow other handlers to also run.

Hi Mani,

Thanks for the feedback, I changed it as you said, sent a v2.

Eugen>
> - Mani
> 


  reply	other threads:[~2026-11-04 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:18 Eugen Hristev
2026-10-16 18:21 ` Bjorn Helgaas
2026-10-16 20:10   ` Eugen Hristev
2026-10-30 17:22     ` Manivannan Sadhasivam
2026-11-04 19:58       ` Eugen Hristev [this message]
2026-11-04 22:31         ` Ray Jui
2026-10-29 21:30 ` Florian Fainelli

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=de273977-8e8d-410e-8424-e99a0b4080b7@kernel.org \
    --to=ehristev@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=rjui@broadcom.com \
    --cc=robh@kernel.org \
    --cc=sbranden@broadcom.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®