[PATCH 1/3] arm64: perf: Make PMU interrupt NMI safe
Julien Thierry
julien.thierry at arm.com
Wed Jan 17 04:27:27 PST 2018
On 17/01/18 12:20, Peter Zijlstra wrote:
> On Wed, Jan 17, 2018 at 12:04:43PM +0000, Julien Thierry wrote:
>> Before using an NMI, we must make sure the IRQ handler uses no locks and
>> only calls NMI safe functions.
>>
>> Get rid of PMU lock, saving and restoring the PMU counter selector in the
>> PMU interrupt handler
>
> You fail to explain why its safe to do so. Presumably that lock was
> there for a reason, why can you remove it and expect things to keep
> working?
>
Right, this was poorly worded. The lock was there to prevent the PMU
interrupt modifying the counter selector register while the interrupted
context was using it.
So the lock was not simply removed, but replaced with the saving and
restoring the selector register value in the interrupt handler.
I'll reword that when I submit a new iteration of that series.
Thanks,
--
Julien Thierry
More information about the linux-arm-kernel
mailing list