[lkml]   [2019]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC][PATCH] perf: Rewrite core context handling
Peter Zijlstra <> writes:

> + // XXX think about exclusive
> + if ((pmu->capabilities & PERF_PMU_CAP_EXCLUSIVE) && group_leader) {
> + err = -EBUSY;
> + goto err_context;
> }

This used to be a problem, because group_leader could have caused
move_group, which could then potentially violate the
exclusive_event_installable() half way through installing siblings onto
the new context (gctx -> ctx). But, with the proposed new order, it's
the same context (ctx), but different epc, which is not a problem; any
potential violations would be caught by

if (!exclusive_event_installable(event, ctx))

that preceeds the move_group block.

It also makes sense that exclusive_event_installable() looks on
ctx->event_list and not epc lists for this exact reason.

In retrospect, we can probably also fix this better in the current code

if (!exclusive_event_installable(event, ctx) ||
!exclusive_event_installable(event, gctx)) /* do -EBUSY */

and get rid of the above restriction to allow grouping "exclusive"


 \ /
  Last update: 2019-05-15 13:57    [W:0.249 / U:65.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site