lkml.org 
[lkml]   [2018]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] perf/core: fix a possible deadlock scenario
On Mon, Jul 23, 2018 at 6:35 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> Hi, Peter, Andi
>
> While reviewing the deadlock, I find out it looks like we could have the
> following infinite recursion too:
>
> perf_event_account_interrupt()
> __perf_event_account_interrupt()
> perf_adjust_period()
> event->pmu->stop
> x86_pmu_stop()
> x86_pmu.disable()

Hmm, x86_pmu_stop() calls __test_and_clear_bit(), so
we should not call x86_pmu.disable() twice here.



> intel_pmu_disable_event()
> intel_pmu_pebs_disable()
> intel_pmu_drain_pebs_buffer()
> intel_pmu_drain_pebs_nhm()
> <repeat....>
>
> This time is pure hardware events, attr.freq must be non-zero.
>
> And, we could enter this infinite recursion in NMI handler too:
>
> intel_pmu_handle_irq()
> perf_event_overflow()
> __perf_event_overflow()
> __perf_event_account_interrupt()
> ....
>
> Or this is impossible too?
>
> Thanks!

\
 
 \ /
  Last update: 2018-07-24 03:45    [W:0.077 / U:5.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site