[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150522133843.GF3644@twins.programming.kicks-ass.net>
Date: Fri, 22 May 2015 15:38:43 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: mingo@...nel.org
Cc: vincent.weaver@...ne.edu, eranian@...gle.com, jolsa@...hat.com,
linux-kernel@...r.kernel.org
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists