Re: [RFC v2 5/7] perf: add a pmu capability for "exclusive" events

From: Alexander Shishkin
Date: Wed Jun 25 2014 - 07:12:32 EST


Peter Zijlstra <peterz@xxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/