[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v9d9k49q.fsf@nanos.tec.linutronix.de>
Date: Thu, 10 Dec 2020 17:35:45 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Jerry Snitselaar <jsnitsel@...hat.com>,
linux-kernel@...r.kernel.org,
Tvrtko Ursulin <tvrtko.ursulin@...el.com>,
Chris Wilson <chris@...is-wilson.co.uk>
Cc: Jason Gunthorpe <jgg@...pe.ca>,
Peter Zijlstra <peterz@...radead.org>,
intel-gfx@...ts.freedesktop.org,
Matthew Garrett <mjg59@...gle.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
David Airlie <airlied@...ux.ie>,
Jarkko Sakkinen <jarkko@...nel.org>,
dri-devel@...ts.freedesktop.org, linux-integrity@...r.kernel.org,
Peter Huewe <peterhuewe@....de>
Subject: Re: [Intel-gfx] [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count
On Thu, Dec 10 2020 at 10:45, Tvrtko Ursulin wrote:
> On 10/12/2020 07:53, Joonas Lahtinen wrote:
>> I think later in the thread there was a suggestion to replace this with
>> simple counter increment in IRQ handler.
>
> It was indeed unsafe until recent b00bccb3f0bb ("drm/i915/pmu: Handle
> PCI unbind") but now should be fine.
>
> If kstat_irqs does not get exported it is easy enough for i915 to keep a
> local counter. Reasoning was very infrequent per cpu summation is much
> cheaper than very frequent atomic add. Up to thousands of interrupts per
> second vs "once per second" PMU read kind of thing.
Why do you need a atomic_add? It's ONE interrupt which can only be
executed on ONE CPU at a time. Interrupt handlers are non-reentrant.
The core code function will just return an accumulated counter nowadays
which is only 32bit wide, which is what the interface provided forever.
That needs to be fixed first.
Aside of that the accounting is wrong when the interrupt line is shared
because the core accounts interrupt per line not per device sharing the
line. Don't know whether you care or not.
I'll send out a series addressing irq_to_desc() (ab)use all over the
place shortly. i915 is in there...
Thanks,
tglx
Powered by blists - more mailing lists