[Top] [All Lists]

Re: [PATCH v5 4/5] MIPS: perf: Add support for 64-bit perf counters.

To: David Daney <>
Subject: Re: [PATCH v5 4/5] MIPS: perf: Add support for 64-bit perf counters.
From: Deng-Cheng Zhu <>
Date: Sat, 24 Sep 2011 10:54:41 +0800
Cc:,, Peter Zijlstra <>, Paul Mackerras <>, Ingo Molnar <>, Arnaldo Carvalho de Melo <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=fey+TXDz5cFMaowLJfIVBegfWp70uNKx74DBolJ+wn8=; b=vl6JKTBcex/nm1wYyhb3bJCgNeeAMvcLFAlT9uP2KM9oiJ+gaj43i8jpflSpiemj8M Pm/jXqA+gtgKOQQvVAGecG76vN1KyxQvHJ0GT7oRULFLASIngN9SerhtlZkhDrdX1dzC na7YoNC6Q1z/DHiYSwElpVn2R/LG4N/zLJREc=
In-reply-to: <>
References: <> <>
2011/9/23 David Daney <>:
> The hard coded constants are moved to struct mips_pmu.  All counter
> register access move to the read_counter and write_counter function
> pointers, which are set to either 32-bit or 64-bit access methods at
> initialization time.
> Many of the function pointers in struct mips_pmu were not needed as
> there was only a single implementation, these were removed.
> I couldn't figure out what made struct cpu_hw_events.msbs[] at all
> useful, so I removed it too.

The idea behind msbs is to simulate 32-bit counters based on the fact
of MIPS using the MSB to trigger the overflow interrupt. By doing this, the
average length of the overflow ISR can be shorter in the case of event
period is bigger than 0x80000000. Also, it simplifies counter value related
algorithms in the code - most of other architectures have 32-bit counters
instead of 31-bit. In addition, taking over those bugfixes can be easier as
a concequence.


<Prev in Thread] Current Thread [Next in Thread>