Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [RFC] synchronized CPU count registers on SMP machines
@ 2003-06-04 22:39 Jun Sun
  2003-06-04 22:51 ` Michael Uhler
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jun Sun @ 2003-06-04 22:39 UTC (permalink / raw)
  To: linux-mips; +Cc: jsun


There are many benefits of having perfectly synchronized CPU
count registers on SMP machines.

I wonder if this is something which have been done before,
and if this is feasible.

Apparently, this scheme won't work if any of the following
conditions are true:

1) clocks on different CPUs don't have the same frequency
2) clocks on different CPUs drift to each other
2) some fancy power saving feature such as frequency scaling

But I think for a foreseeable future most MIPS SMP machines
don't have the above issues (true?).  And it is probably worthwile
to synchronize count registers for them.

I think some pseudo code like the below could get the 
job done:

CPU 0:
	send interrupt to all other CPUs and ask them to sync count
	wait for all other CPUs to gather at rendevous point
	flip a flag
	set count to 0

other CPUs:
	trapped by IPI
	reach the rendevous point (busy spin locking)
	wait for the flip of the flag
	set count to 0

I wonder after the above code how synchronized are the count regsiters.
Are they perfectly synchronized or still differ by a few counts?

Any comments?

Jun

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <ralf@linux-mips.org>]

end of thread, other threads:[~2003-06-05 20:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-04 22:39 [RFC] synchronized CPU count registers on SMP machines Jun Sun
2003-06-04 22:51 ` Michael Uhler
2003-06-04 22:51   ` Michael Uhler
2003-06-04 23:44   ` Jun Sun
2003-06-04 23:15 ` Ralf Baechle
2003-06-04 23:46   ` Jun Sun
2003-06-05  0:12     ` Ralf Baechle
2003-06-05  1:38       ` Jun Sun
2003-06-05  8:09         ` Dominic Sweetman
2003-06-05  8:48           ` Ralf Baechle
2003-06-05 16:53             ` Jun Sun
2003-06-05 20:06               ` Greg Lindahl
2003-06-05 10:45       ` Alan Cox
2003-06-05  8:55     ` Kevin D. Kissell
2003-06-05  8:51       ` Ralf Baechle
2003-06-05  8:55       ` Kevin D. Kissell
2003-06-05 11:08       ` Maciej W. Rozycki
2003-06-05  0:18 ` Keith Owens
     [not found] <ralf@linux-mips.org>
2003-06-05  9:23 ` Tor Arntsen

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