Messages in this thread | | | Date | Fri, 22 May 2015 15:38:43 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH v2 11/11] perf/x86: Simplify put_exclusive_constraints |
| |
On Fri, May 22, 2015 at 03:29:16PM +0200, Peter Zijlstra wrote: > @@ -2149,22 +2147,25 @@ static void intel_put_excl_constraints(s > } > > /* > + * If event was actually assigned, then mark the counter state as > + * unused now. > */ > + if (hwc->idx >= 0) { > + xl = &excl_cntrs->states[tid]; > + > + /* > + * put_constraint may be called from x86_schedule_events() > + * which already has the lock held so here make locking > + * conditional. > + */ > + if (!xl->sched_started) > + raw_spin_lock(&excl_cntrs->lock); > > xl->state[hwc->idx] = INTEL_EXCL_UNUSED; > > + if (!xl->sched_started) > + raw_spin_unlock(&excl_cntrs->lock); > + } > }
Hmm, we could probably avoid the lock and use WRITE_ONCE() to clear this state, but I'm too tired to really think about it.
| |