Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Re: time.c CP0_COMPARE
       [not found]   ` <3D6E5C58.405@mvista.com>
@ 2002-09-02 16:30     ` Ralf Baechle
  2002-09-03 16:59       ` time.c CP0_COMPARE (and SMP IPI rambling) Jun Sun
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2002-09-02 16:30 UTC (permalink / raw)
  To: Jun Sun; +Cc: Matthew Dharm, Linux-MIPS

On Thu, Aug 29, 2002 at 10:39:36AM -0700, Jun Sun wrote:

> Ralf Baechle wrote:

> >  c0_compare = c0_count + mips_counter_frequency / HZ.
> > 
> > That's what the individual boards are currently doing themselves though that
> > should be done in generic code.
> > 
>
> Good idea.
> 
> The attached patch attempts to set the first interrupt. It should be benign 
> even if a system is not using CPU counter as timer interrupt.
> 
> I also updated the time.README, including a new section about implementation 
> on a SMP machine.

Applied though I think that this should also be done via start_secondary
that is we'll need some per_cpu_time_init analog to per_cpu_trap_init.
Also of course your change makes some cleanup possible as the initialization
no happens twice for a bunch of platforms.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: time.c CP0_COMPARE (and SMP IPI rambling)
  2002-09-02 16:30     ` time.c CP0_COMPARE Ralf Baechle
@ 2002-09-03 16:59       ` Jun Sun
  2002-09-04 10:50         ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Jun Sun @ 2002-09-03 16:59 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Matthew Dharm, Linux-MIPS

Ralf Baechle wrote:
> On Thu, Aug 29, 2002 at 10:39:36AM -0700, Jun Sun wrote:
> 
> 
>>Ralf Baechle wrote:
> 
> 
>>> c0_compare = c0_count + mips_counter_frequency / HZ.
>>>
>>>That's what the individual boards are currently doing themselves though that
>>>should be done in generic code.
>>>
>>
>>Good idea.
>>
>>The attached patch attempts to set the first interrupt. It should be benign 
>>even if a system is not using CPU counter as timer interrupt.
>>
>>I also updated the time.README, including a new section about implementation 
>>on a SMP machine.
> 
> 
> Applied though I think that this should also be done via start_secondary
> that is we'll need some per_cpu_time_init analog to per_cpu_trap_init.

Right now setting per-cpu timers is totally left to the board-dependent code. 
  Once we see more SMP boxes using this approach, I think it starts to be 
interesting to make some abstraction and support it in a systematic way, 
including support for using CPU counter as the per-cpu timer interrupt.

Using local_timer_emulation sounds like an attractive alternative to me, as we 
only need to set up one system-wide timer interrupt.  Conceptually it probably 
takes a little longer to run through timer_interrupt (due to IPI calls).  But 
if the hit on performance is very negligible, the simplicity might make it 
worthwile.

BTW, since I am here, I like to ramble on a little bit further.  Currently 
Linux supports two kinds of IPI (inter-processor interrupt) deliveries:

1) sender waiting for the interrupt handler to start
2) sender waiting for the interrupt handler to start and complete

I think we really should the third kind:

3) sender does not wait at all.  Just delivers the interrupt.

With this support, the emulated local timer approach would have no performance 
penalty at all.

Jun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: time.c CP0_COMPARE (and SMP IPI rambling)
  2002-09-03 16:59       ` time.c CP0_COMPARE (and SMP IPI rambling) Jun Sun
@ 2002-09-04 10:50         ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2002-09-04 10:50 UTC (permalink / raw)
  To: Jun Sun; +Cc: Ralf Baechle, Matthew Dharm, Linux-MIPS

On Tue, 3 Sep 2002, Jun Sun wrote:

> Right now setting per-cpu timers is totally left to the board-dependent code. 
>   Once we see more SMP boxes using this approach, I think it starts to be 
> interesting to make some abstraction and support it in a systematic way, 
> including support for using CPU counter as the per-cpu timer interrupt.
> 
> Using local_timer_emulation sounds like an attractive alternative to me, as we 
> only need to set up one system-wide timer interrupt.  Conceptually it probably 
> takes a little longer to run through timer_interrupt (due to IPI calls).  But 
> if the hit on performance is very negligible, the simplicity might make it 
> worthwile.

 Well, the i386 approach (with a grain of salt, of course, but it's about
the most mature, anyway) seems reasonable.  A per-CPU local timer for
scheduling (no need to stability or high precision) and an external timer
interrupt for timekeeping (this one precise) that's delivered to a single
CPU at a time.  I hope there are no MIPS SMP systems that lack an external
timer IRQ source. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-04 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <NEBBLJGMNKKEEMNLHGAIEEKHCIAA.mdharm@momenco.com>
     [not found] ` <20020829142133.A3905@bacchus.dhis.org>
     [not found]   ` <3D6E5C58.405@mvista.com>
2002-09-02 16:30     ` time.c CP0_COMPARE Ralf Baechle
2002-09-03 16:59       ` time.c CP0_COMPARE (and SMP IPI rambling) Jun Sun
2002-09-04 10:50         ` Maciej W. Rozycki

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