mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] (comments requested) adding finer-grained timing to PPC  add_timer_randomness()
Date: Thu, 23 Aug 2001 11:33:59 +1000 (EST)	[thread overview]
Message-ID: <15236.23943.260421.31691@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <3B8423B9.29B1293A@nortelnetworks.com>
In-Reply-To: <Pine.LNX.4.33.0108221702300.12521-100000@terbidium.openservices.net> <3B8423B9.29B1293A@nortelnetworks.com>

Chris Friesen writes:

> > +extern int have_timebase;
> >   ...
> 
> > Am I missing something, or should at least one of these not be extern?
> 
> 
> Okay, I feel dumb.  You're right of course. I guess I must have missed the
> compiler warning.

I accidently deleted the message with the patch, but my comment would
be that the way we have tended to handle this sort of thing is by
reading the PVR register (processor version register) each time rather
than by setting a flag in memory and testing that, since I expect that
reading a special-purpose register in the CPU should be faster than
doing a load from memory.

In the 2.4 tree we have code that works out a cpu features word from
the PVR value.  The cpu features word has bits for things like does
the cpu have the TB register, does the MMU use a hash table, does the
cpu have separate I and D caches, etc.

The other thing you could consider is using the value in the
decrementer register rather than the TB or RTC.  The timer interrupt
is signalled when the DEC transitions from 0 to -1, and the DEC keeps
decrementing (at the same rate that the TB increments, on cpus which
have a TB).  I assume that the source of randomness that you are
trying to capture is the jitter in the timer (decrementer) interrupt
latency.  AFAICS you could get that from DEC just as well as from the
TB/RTC and it would have the advantage that you would not need a
conditional on the processor version.

There is a list, linuxppc-dev@lists.linuxppc.org, where you will find
a greater concentration of PPC kernel developers.  There is nothing
wrong with discussing this stuff on linux-kernel but you may perhaps
get more informed responses on linuxppc-dev. :)

Paul.

  parent reply	other threads:[~2001-08-23  1:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-22 20:57 Chris Friesen
2001-08-22 21:06 ` Ignacio Vazquez-Abrams
2001-08-22 21:27   ` Chris Friesen
2001-08-23  1:33   ` Paul Mackerras [this message]
2001-08-23  9:46     ` Gabriel Paubert
2001-08-23 13:11       ` Benjamin Herrenschmidt
2001-08-23 12:31     ` Paul Mackerras
2001-08-24  7:32       ` Gabriel Paubert
2001-08-24 13:59         ` Christopher Friesen
2001-08-28 20:50           ` Gabriel Paubert
2001-08-24 17:54         ` [PATCH] (comments requested) adding finer-grained timing to PPC Albert D. Cahalan

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=15236.23943.260421.31691@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®