[Top] [All Lists]

[RFC] Support cpu timer for SMP case

Subject: [RFC] Support cpu timer for SMP case
From: Jun Sun <>
Date: Tue, 20 Apr 2004 15:23:06 -0700
Original-recipient: rfc822;
User-agent: Mutt/1.2.5i
This patch illustrates that the cpu timer can be used as
system timer on a SMP system:

1) count/compare on CPU 0 registers are used to generate 
   jiffy interrupts

2) at the end of processing jiffy interrupt, cpu 0 sends
   a special inter-processor interrupt (IPI) to all other
   cpus and make them do process accounting stuff 

3) count registers on all CPU 0 are sync'ed up at the beginning.
   As a result we will have a consistent time reading on 
   all CPUs (do_gettimeofday()).

This patch assumes that the count registers on different CPUs
don't drift from each other after they sync up.  If they do drift,
we can change the code to allow periodic sync up.  We can
probably even support different count frequencies.

This patch is actually tested to be working on sibyte boards.

As a by-product of the patch we also fix a "gettimeofday() going backward"
problem on those smp boards.


P.S., the patch really looks more complicated than it should be, because
        I am leaving the old time code for the board there but "ifdef"ed out.
        If we make a complete transition to cpu timer, all the ifdef's and
        old time code for the board should go away.

Attachment: 040420.a-cpu-timer-for-smp.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>
  • [RFC] Support cpu timer for SMP case, Jun Sun <=