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_start_scheduling(struct cpu_hw_events *cpuc)
> +{

> + /*
> + * lock shared state until we are done scheduling
> + * in stop_event_scheduling()
> + * makes scheduling appear as a transaction
> + */
> + spin_lock_irqsave(&excl_cntrs->lock, excl_cntrs->lock_flags);
> +
> + /*
> + * save initial state of sibling thread
> + */
> + memcpy(xlo->init_state, xlo->state, sizeof(xlo->init_state));
> +}
> +
> +static void
> +intel_stop_scheduling(struct cpu_hw_events *cpuc)
> +{

> + /*
> + * make new sibling thread state visible
> + */
> + memcpy(xlo->state, xlo->init_state, sizeof(xlo->state));
> +
> + xl->sched_started = false;
> + /*
> + * release shared state lock (lock acquire in intel_start_scheduling())
> + */
> + spin_unlock_irqrestore(&excl_cntrs->lock, excl_cntrs->lock_flags);
> +}

Do you really need the irqsave/irqrestore? From what I can tell this is
always called under perf_event_context::lock and that is already an
IRQ-safe lock, so interrupts should always be disabled here.

Also, it looks like xl->state is the effective state, and ->init_state
is the work state? Is init the right name for this?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-06-05 16:21    [W:0.228 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site