All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Marc Zyngier" <maz@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	"Ingo Molnar" <mingo@kernel.org>
Subject: Re: Question on threaded handlers for managed interrupts
Date: Fri, 23 Apr 2021 13:02:51 +0100	[thread overview]
Message-ID: <c297d618-1378-f51b-45db-605a3fc15336@huawei.com> (raw)
In-Reply-To: <874kfxw9zv.ffs@nanos.tec.linutronix.de>

On 23/04/2021 11:50, Thomas Gleixner wrote:

Hi Thomas,

>> The multi-queue storage controller (see [1] for memory refresh, but
>> note that I can also trigger on PCI device host controller as well) is
>> using managed interrupts and threaded handlers. Since the threaded
>> handler uses SCHED_FIFO, aren't we always vulnerable to this situation
>> with the managed interrupt and threaded handler combo? Would the
>> advice be to just use irq polling here?
> This is a really good question. Most interrupt handlers are not running
> exceedingly long or come in with high frequency, but of course this
> problem exists.
> 
> The network people have solved it with NAPI which disables the interrupt
> in the device and polls it from softirq context (which might be then
> delegated to ksoftirqd) until it's drained.
> 
> I'm not familiar with the block/multiqueue layer to be able to tell
> whether such a concept exists there as well.
> 

Other MQ SCSI drivers have had similar problems. They were handling all 
completion interrupts in hard irq context, the handlers would not exit 
for high throughput scenarios, and they were then getting lockups.

Their solution was to switch over to using irq_poll for when per-queue 
completions got above a certain rate.

> OTOH, the way how you splitted the handling into hard/thread context
> provides already the base for this.
>

Right, so I could switch to a similar scheme, above, but just think that 
what I have in using a threaded handler would already suffice.

> The missing piece is infrastructure at the irq/scheduler core level to
> handle this transparently.
> 
> I have some horrible ideas how to solve that, but I'm sure the scheduler
> wizards can come up with a reasonable and generic solution.

That would be great.

Thanks,
John

  reply	other threads:[~2021-04-23 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 16:10 Question on threaded handlers for managed interrupts John Garry
2021-04-23 10:50 ` Thomas Gleixner
2021-04-23 12:02   ` John Garry [this message]
2021-04-23 13:01   ` Thomas Gleixner
2021-04-23 15:00     ` John Garry
2021-05-21 12:46     ` John Garry

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=c297d618-1378-f51b-45db-605a3fc15336@huawei.com \
    --to=john.garry@huawei.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.