Messages in this thread | | | From | Alexander Shishkin <> | Subject | Re: [RFC v2 5/7] perf: add a pmu capability for "exclusive" events | Date | Wed, 25 Jun 2014 14:12:05 +0300 |
| |
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
| |