lkml.org 
[lkml]   [2014]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC v2 5/7] perf: add a pmu capability for "exclusive" events
    Date
    Peter Zijlstra <peterz@infradead.org> writes:

    > On Wed, Jun 11, 2014 at 06:41:48PM +0300, Alexander Shishkin wrote:
    >> +static bool exclusive_event_ok(struct perf_event *event,
    >> + struct perf_event_context *ctx)
    >> +{
    >> + struct perf_event *iter_event;
    >> +
    >> + if (!(event->pmu->capabilities & PERF_PMU_CAP_EXCLUSIVE))
    >> + return true;
    >> +
    >> + list_for_each_entry(iter_event, &ctx->event_list, event_entry) {
    >> + if (exclusive_event_match(iter_event, event))
    >> + return false;
    >> + }
    >
    > This list iteration needs either rcu or ctx->lock or ctx->mutex, and the
    > two callsites below don't have either afaict.

    True, this needs to be done before perf_install_in_context() under the
    same ctx->mutex. Thanks!

    Regards,
    --
    Alex


    \
     
     \ /
      Last update: 2014-06-25 14:41    [W:3.855 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site