Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* {rd,wr}unique palcode insns
@ 1996-09-10 22:52 Richard Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 1996-09-10 22:52 UTC (permalink / raw)


Does anyone know what the rdunique/wrunique unprivileged PALcode
traps are for?  Do they, as they appear, allow one value to be stored
per-thread?  How are they used in DEC Unix?  What kind of performance
hit do I take trapping to PALcode?

I ask because I was thinking of changing the LinuxThreads code to use
this for its thread id, rather than doing some screwy stack pointer
lookup nonsense as is necessary for other platforms.

Anyone see a problem with this?

r~

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: {rd,wr}unique palcode insns
@ 1996-09-10 23:18 David Mosberger
  0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger @ 1996-09-10 23:18 UTC (permalink / raw)


> Does anyone know what the rdunique/wrunique unprivileged PALcode
 > traps are for?  Do they, as they appear, allow one value to be stored
 > per-thread?

Yes, the value is per (kernel-) thread.  If you look at pseudo-code
for the swpctx PALcall, you'll see that the unique value gets stored
in the "process" control block.  In Linux, the corresponding variable
is the "unique" member in processor.h:struct thread_struct.

 > How are they used in DEC Unix?

Don't know.  I don't think the architecture manual says so explicitly,
but the intent seems to be that the kernel does not interpret the
unique value in any manner.  I.e., you're free to use it in any way
you like.

 > What kind of performance hit do I take trapping to PALcode?

Switching to PALmode is "fast".  I don't have any numbers that measure
this overhead alone, but on a 175MHz Alpha (DEC 3000/600) machine the
overhead for rdps or rdunique (I forgot which) was 13 cycles (assuming
a warm cache).  Note that the Alpha CPUs have shadow registers in
PALmode, so in many cases the PALcode itself doesn't have to access
memory at all.  I don't know the implementation details, but AFAIK,
entering PALmode is not much more than flipping a bit in the CPU.  The
biggest performance hit seems to come from the various scheduling and
synchronization restrictions inside PALmode.  See the hardware
reference for all the gory details (and I mean _gory_... ;-)

 > I ask because I was thinking of changing the LinuxThreads code to use
 > this for its thread id, rather than doing some screwy stack pointer
 > lookup nonsense as is necessary for other platforms.

 > Anyone see a problem with this?

I think that is exactly what it is designed for.

	--david

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <199609102252.RAA12047@atheist.tamu.edu>]

end of thread, other threads:[~1996-09-11  4:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-09-10 22:52 {rd,wr}unique palcode insns Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1996-09-10 23:18 David Mosberger
     [not found] <199609102252.RAA12047@atheist.tamu.edu>
1996-09-11  4:50 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox