[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <875zabyeyo.wl-maz@kernel.org>
Date: Sat, 25 Jul 2020 13:08:31 +0100
From: Marc Zyngier <maz@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: John Keeping <john@...anate.com>,
LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Ben Herrenschmidt <benh@...zon.com>,
Ali Saidi <alisaidi@...zon.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V2] genirq/affinity: Handle affinity setting on inactive interrupts correctly
Hi both,
On Fri, 24 Jul 2020 21:03:50 +0100,
Thomas Gleixner <tglx@...utronix.de> wrote:
>
> John,
>
> John Keeping <john@...anate.com> writes:
> > On Fri, 17 Jul 2020 18:00:02 +0200
> > Thomas Gleixner <tglx@...utronix.de> wrote:
> > It seems that this patch breaks perf events on RK3288 because the PMU
> > interrupts that should be per-cpu are now all on CPU0 so no events are
> > collected from CPUs 1-3 and those interrupts are killed as spurious
> > after a few seconds.
SPI-backed PMUs. Urgh...
> >
> > I'm seeing this on 4.19.134 and 5.4.53 but as far as I can tell the
> > relevant code hasn't changed through to next-20200723. Reverting the
> > backport of this change fixes the problem.
>
> Bah.
>
> > It looks like what happens is that because the interrupts are not
> > per-CPU in the hardware, armpmu_request_irq() calls irq_force_affinity()
> > while the interrupt is deactivated and then request_irq() with
> > IRQF_PERCPU | IRQF_NOBALANCING.
> >
> > Now when irq_startup() runs with IRQ_STARTUP_NORMAL, it calls
> > irq_setup_affinity() which returns early because IRQF_PERCPU and
> > IRQF_NOBALANCING are set, leaving the interrupt on its original CPU.
>
> Right. My brain tricked me to believe that we made activation mandatory,
> but that's not.
>
> I have some ideas for a trivial generic way to solve this without
> undoing the commit in question and without going through all the irq
> chip drivers. So far everything I came up with is butt ugly. Maybe Marc
> has some brilliant idea.
Not really. We have contradicting behaviours here, where some
interrupts want to see the set_affinity early (the above case), and
some cannot handle that (x86 vectors and the GICv3 ITS). We could key
it on the presence of an activate callback, but it feels fragile.
I'll follow up on your patch in the next email, which seems like a
sensible approach.
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists