• Frederic Weisbecker's avatar
    perf: Fix forgotten preempt_enable by nested writers · acd35a46
    Frederic Weisbecker authored
    A writer that gets a reference to the buffer handle disables
    preemption. When we put that reference, we check if we are
    the outer most writer and if not, we simply return and defer
    the head update to the outer most writer. The problem here
    is that preemption is only reenabled by the outer most, that
    produces preemption count imbalance for every nested writer
    that exit.
    
    So just don't forget to always re-enable preemption when we
    put the buffer reference, whoever we are.
    
    Fixes lots of sleeping in atomic warnings, visible with lock
    events recording.
    Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Robert Richter <robert.richter@amd.com>
    acd35a46
perf_event.c 131 KB