• S
    perf_events: Fix rcu and locking issues with cgroup support · 3f7cce3c
    Stephane Eranian 提交于
    This patches ensures that we do not end up calling
    perf_cgroup_from_task() when there is no cgroup event.
    This avoids potential RCU and locking issues.
    
    The change in perf_cgroup_set_timestamp() ensures we
    check against ctx->nr_cgroups. It also avoids calling
    perf_clock() tiwce in a row. It also ensures we do need
    to grab ctx->lock before calling the function.
    
    We drop update_cgrp_time() from task_clock_event_read()
    because it is not needed. This also avoids having to
    deal with perf_cgroup_from_task().
    
    Thanks to Peter Zijlstra for his help on this.
    Signed-off-by: NStephane Eranian <eranian@gmail.com>
    Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <4d5e76b8.815bdf0a.7ac3.774f@mx.google.com>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    3f7cce3c
perf_event.c 168.7 KB