Re: OS Clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/23/07, Erik Mouw <mouw@xxxxxxxxxxxx> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Mar 23, 2007 at 09:37:53AM -0000, Martyn Welch wrote:
> > -----Original Message-----
> > From: kernelnewbies-bounce@xxxxxxxxxxxx
> > [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of
> > Bithika Khargharia
> > Sent: 23 March 2007 05:08 AM
> > To: kernelnewbies@xxxxxxxxxxxx
> > Subject: OS Clock
> >
> > I have few hardware counters that I want to read data from
> > every nano second.
>
> Hi Bithika,
>
> I think you need to look at the praticality of what you are asking.
>
> Reading 1 register every nano second would require reading it at a
> frequency of 1GHz. Reading anything at this kind of rate would require
> quite specialised hardware.

Assuming that a current 3GHz CPU can do the read in 1 clock cycle
(which it can't but let's just assume it can), you have 2 clock cycles
left to do something useful with the value you read. You might just be
able to write it to memory, assuming a memory write also happens in 1
clock cycle. But you can't take interrupts because entering the ISR
already takes more than one clock cycle. You also can't have another
CPU accessing memory at the same time because that will stall the CPU
writing counter values.

Thank you for both of your replies. Reading these registers through the CPU does not make sense as you rightly pointed out. I was thinking more along the lines of a DMA kind of mechanism. I know that these registers have a memory-mapped area that can be used to configure them from the OS and program the counters to read different events. In a similar manner, if it was possible to have the counters write to some other memory-mapped area one could then read the data from that memory-area after the experiments are done. Is that a possibility?

I agree with Martyn that you need some serious specialised hardware
because a computer only reading a register every ns doesn't sound very
useful to me.


Erik

- --
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGA+g6/PlVHJtIto0RAtIfAKCOH5rvzcB3lVJACCfcGCk99TriKwCbBIUh
Qekc/38yO40tAv0yQ1UiaVo=
=UXpv
-----END PGP SIGNATURE-----



--
Something happens to people who love wine. It's not like coin collecting or something cynical. It's like sharing love in a glass.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux