Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1289514

Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes
Date 2015-12-11 13:20 +0100
Message-ID <qEuQ2-486-29@gated-at.bofh.it> (permalink)
References <qvSRz-8wu-5@gated-at.bofh.it> <qvSRB-8wu-35@gated-at.bofh.it> <qEbDI-87n-15@gated-at.bofh.it> <qEu3H-3z9-75@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Dec 11, 2015 at 11:28:45AM +0000, Suzuki K. Poulose wrote:
> On 10/12/15 15:42, Mark Rutland wrote:
> >On Tue, Nov 17, 2015 at 06:03:27PM +0000, Suzuki K. Poulose wrote:
> >>The CCI PMU driver sets the event counter to the half of the maximum
> >>value(2^31) it can count before we start the counters via
> >>pmu_event_set_period(). This is done to give us the best chance to
> >>handle the overflow interrupt, taking care of extreme interrupt latencies.
> 
> 
> >
> >This should work, but it seems very heavyweight given we do it for each
> >write.
> >
> >Can we not amortize this by using the {start,commit,cancel}_txn hooks?
> >
> >Either we can handle 1-4 and 6-8 in those, or we can copy everything
> >into a shadow state and apply it all in one go at commit_txn time.
> 
> I took a look at it. The only worrying part is, if pmu->add() will be
> called outside *_txn().

It looks like that happns.

If we __perf_event_enable an events which is not a leader, we may call
event_sched_in (which will call pmu->add) outside of a transaction. The
__perf_event_disable path is similar w.r.t. pmu->del.

So it does look like we can't rely on being in a transaction there.

Assuming that's deliberate, we could follow the example of other PMU
drivers and keep track of whether or not we're in a transaction. If not,
we do all the heavyweight work inline.

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes Mark Rutland <mark.rutland@arm.com> - 2015-12-10 16:50 +0100
  Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-12-11 12:30 +0100
    Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes Peter Zijlstra <peterz@infradead.org> - 2015-12-11 13:20 +0100
    Re: [PATCHv3 5/5] arm-cci: CCI-500: Work around PMU counter writes Mark Rutland <mark.rutland@arm.com> - 2015-12-11 13:20 +0100

csiph-web