linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: benh@kernel.crashing.org
Cc: paulus@samba.org, albert@users.sourceforge.net,
	oprofile-list@lists.sourceforge.net,
	linuxppc-dev@lists.linuxppc.org, segher@koffie.nl,
	o.oppitz@web.de, afleming@motorola.com,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] oprofile for ppc
Date: 08 Mar 2003 14:30:29 -0500	[thread overview]
Message-ID: <1047151830.2012.149.camel@cube> (raw)
In-Reply-To: <1047136206.12202.85.camel@zion.wanadoo.fr>

On Sat, 2003-03-08 at 10:10, Benjamin Herrenschmidt wrote:
> On Fri, 2003-03-07 at 19:31, Albert Cahalan wrote:

>> This is just the first part of the code. Please merge it
>> into any tree you have, unless it's obviously broken.
>> It is useful for long-running processes that don't do
>> much that is tied to the clock tick. (number crunching,
>> maybe X, web browsers without animations, /tmp cleaner...)
>>
>> The i386 port is already using 1000 Hz in the kernel,
>> and has 100 Hz as a non-default option. I'd really like
>> to have this on my Mac; lots of things would improve.
>>
>> I intend to allow sampling based on the performance counter
>> interrupt/trap/exception and the external interrupt signal.
>
> Ok. I'll ask paulus about merging this.
>
> Beware though that some G4s have a nasty bug that prevents
> using the performance counter interrupt (and the thermal interrupt
> as well). The problem is that if any of those fall at the same
> time as the DEC interrupt, the CPU messes up it's internal
> state and you lose SRR0/SRR1, which means you can't recover
> from the exception.

Ouch. Motorola's description looks really suspicious.
The other interrupts "not affected by this errata"
might not suffer the 2-cycle MSR(EE) reset delay,
but they sure would interact with the broken ones.

MPC7400PNS.pdf doesn't list the bug; is a MPC7400 OK?
If not, perhaps you can send me some better info.

The decrementer isn't needed on systems with the
performance monitor. Simply require that one of the
PMCx registers count something like clock ticks, and
require that performance monitor interrupts be enabled.
Problem solved, eh?

> Note also that it should be relatively easy to have the
> DEC timer run faster than HZ. The code in timer.c can
> deal with spurrious DEC interrupts, so you may improve
> your results by just making it fire at 1Khz or higher.

How about this:

Bound the alarm clock (decrementer or an alternative)
setting such that it always fires between 10000 bus
cycles (safe number?) and 1/4000 second into the future.
Update jiffies purely based on the timebase register.
HZ is 1000. This ought to help with high-res timers.

If that special page at the top of user-space got
implemented (did it?), supply timebase frequency and
offset info there for non-SMP systems. (and for SMP
too if somebody cares to count the 60x/MPX bus cycles
involved in synchronizing timebase registers)



  reply	other threads:[~2003-03-08 19:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-07  9:29 [patch] oprofile for ppc Albert D. Cahalan
2003-03-07 10:13 ` Benjamin Herrenschmidt
2003-03-07 18:31   ` Albert Cahalan
2003-03-08 15:10     ` Benjamin Herrenschmidt
2003-03-08 19:30       ` Albert Cahalan [this message]
2003-03-08 21:41         ` Benjamin Herrenschmidt
2003-03-10  4:00           ` Segher Boessenkool
2003-03-10  3:50       ` Segher Boessenkool
2003-03-10  6:31         ` Albert Cahalan
2003-03-10  8:43           ` Benjamin Herrenschmidt
2003-03-11  2:14           ` Segher Boessenkool
2003-03-11 21:54             ` Andrew Fleming
2003-03-11 23:13               ` Albert Cahalan
2003-03-12  0:25                 ` Andrew Fleming
2003-03-11 23:30               ` mikpe
2003-03-12  0:10                 ` Albert Cahalan
2003-03-12 10:42                   ` mikpe
2003-03-10  8:38         ` Benjamin Herrenschmidt
2003-03-20 21:32 ` Andy Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1047151830.2012.149.camel@cube \
    --to=albert@users.sf.net \
    --cc=afleming@motorola.com \
    --cc=albert@users.sourceforge.net \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=o.oppitz@web.de \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=paulus@samba.org \
    --cc=segher@koffie.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).