lkml.org 
[lkml]   [2014]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/9] perf/x86: implement cross-HT corruption bug workaround
On Wed, Jun 04, 2014 at 11:34:14PM +0200, Stephane Eranian wrote:
> +static void intel_commit_scheduling(struct cpu_hw_events *cpuc,
> + struct perf_event *event, int cntr)
> +{
> + struct intel_excl_cntrs *excl_cntrs = cpuc->excl_cntrs;
> + struct event_constraint *c = event->hw.constraint;
> + struct intel_excl_states *xlo, *xl;
> + int tid = cpuc->excl_thread_id;
> + int o_tid = 1 - tid;
> + int is_excl;
> +
> + if (cpuc->is_fake || !c)
> + return;
> +
> + is_excl = c->flags & PERF_X86_EVENT_EXCL;
> +
> + if (!(c->flags & PERF_X86_EVENT_DYNAMIC))
> + return;
> +
> + WARN_ON_ONCE(!excl_cntrs);
> +
> + if (!excl_cntrs)
> + return;
> +
> + xl = &excl_cntrs->states[tid];
> + xlo = &excl_cntrs->states[o_tid];
> +
> + WARN_ON_ONCE(!spin_is_locked(&excl_cntrs->lock));

Use:
lockdep_assert_held(&excl_cntrs->lock);

It also checks to see the current context is actually the lock holder,
and it doesn't generate any code when !lockdep.

> +
> + if (cntr >= 0) {
> + if (is_excl)
> + xlo->init_state[cntr] = INTEL_EXCL_EXCLUSIVE;
> + else
> + xlo->init_state[cntr] = INTEL_EXCL_SHARED;
> + }
> }
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-06-05 16:41    [W:0.309 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site