lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2015-05-22 16:01    [W:0.165 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site