public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: dirk.behme@de•bosch.com (Dirk Behme)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] ARM: imx6q: work around faulty PMU irq routing
Date: Tue, 29 Apr 2014 13:17:03 +0200	[thread overview]
Message-ID: <535F8A2F.2060507@de.bosch.com> (raw)
In-Reply-To: <1398765300.4677.8.camel@weser.hi.pengutronix.de>

On 29.04.2014 11:55, Lucas Stach wrote:
> Am Dienstag, den 29.04.2014, 13:28 +0800 schrieb Shawn Guo:
>> On Fri, Apr 25, 2014 at 11:13:25AM +0200, Lucas Stach wrote:
>>> Am Freitag, den 25.04.2014, 07:37 +0200 schrieb Dirk Behme:
>>>> On 24.04.2014 22:23, Lucas Stach wrote:
>>>>> The i.MX6 PMU has a design errata where the interrupts of all cores are
>>>>> wired together into a single irq line. To work around this we have to
>>>>> bounce the interrupt around all cores until we find the one where the PMU
>>>>> counter overflow has happened.
>>>>>
>>>>> This causes the perf measurements to be less accurate and we can't really
>>>>> handle the case where two cores fire a PMU irq at the same time. The
>>>>> implemented woraround makes perf at least somewhat useable on imx6 SoCs
>>>>> with more than one core.
>>>>>
> [...]
>>>> Do you have anything like a test case which shows that it works (at
>>>> least better) on a !single core with this patch? Compared to a
>>>> non-patched system?
>>>>
>>> Without this patch, running perf top completely kills the system on
>>> i.MX6q, most likely because of the sheer number of spurious interrupts
>>> hitting the system from 4 cores. Even the spurious killer doesn't work
>>> sometimes, so perf is completely busted right now.
>>>
>>> With this patch perf has to reduce the sample frequency in order to
>>> compensate the added irq latency, but at least we get some plausible
>>> numbers out. Though I won't take any blame if the amount of salt you
>>> have to apply while looking at those numbers is already a deadly
>>> dose. ;)
>>>
>>> I don't yet have any numbers on how accurate the measurement is, but at
>>> least things didn't look completely off.
>>
>> If it cannot provide correct/accurate data, I'd say let's not fake it
>> to, and just let it be completely broken there, so that people can be
>> aware of the brokenness, and not take inaccurate data as accurate one.
>>
> The data isn't bogus, it just isn't as accurate as it could be with a
> properly working PMU. I'll run some tests with a defined load on
> Solo/Quad to see how far the measurements are off. I'm fine with holding
> this patch until then.
>
> But the thing is this patch also fixes a serious userspace triggerable
> DoS on i.MX6q. Just running perf top completely locks up the system
> because of the sheer number of stray irqs. This isn't the case anymore
> with this patch applied.
>
> Maybe we can just print a warning into dmesg to make the users aware of
> the imprecise measurement.

Yes, I think this sounds like a good compromise :)

Best regards

Dirk

  reply	other threads:[~2014-04-29 11:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 20:23 [PATCH] ARM: imx6q: work around faulty PMU irq routing Lucas Stach
2014-04-24 20:32 ` Fabio Estevam
2014-04-25  5:33   ` Dirk Behme
2014-04-25  5:37 ` Dirk Behme
2014-04-25  9:13   ` Lucas Stach
2014-04-29  5:28     ` Shawn Guo
2014-04-29  9:55       ` Lucas Stach
2014-04-29 11:17         ` Dirk Behme [this message]
2014-04-29 18:33           ` Frank Li
2014-04-30  9:21             ` Lucas Stach

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=535F8A2F.2060507@de.bosch.com \
    --to=dirk.behme@de$(echo .)bosch.com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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