Re: What are the different timer that exists in the kernel?

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

 



Thank you for your reply Sitsofe.   I hope you will allow me to share
with the Kernelnewbies team as well.

On Wed, Sep 17, 2008 at 8:17 PM, Sitsofe Wheeler <sitsofe@xxxxxxxxx> wrote:
> Peter Teoh wrote:
>>
>> Just purely based on symbol search, I can see these different timer in
>> the system:
>>
>> c01124ab t create_pit_timer
>> c0158d7c T posix_cpu_timer_create
>> c0158e7d t process_cpu_timer_create
>> c01569c9 T sys_timer_create
>> c01575e8 W sys_timerfd_create
>> c0158e67 t thread_cpu_timer_create
>>
>>
>> a.   what are the differences among these different timer?
>
> I think the underlying hardware timer used by most of the functions you
> mention is actually the same. The only real differences are the interfaces
> exposing how you program events on it.
>
> I believe resolution and how you can use the timers is the main difference
> between posix and timerfd calls. For example the API for posix timers is
> pretty much set in stone so if you want to expose a timer with different
> properties you will need a different call. According to
> http://lwn.net/Articles/245533/ and
> http://kernelnewbies.org/Linux_2_6_25#head-ae00db3cc69df29b62a33d6993adb5102b228fa7
> timerfd came about because it eliminates the need for signal based timers
> (you get a file descriptor with your timer back) and additionally you can
> find out how many times your timer has fired if you have missed it a few
> times.
>
> There are also different hardware timer devices. These have different
> properties and may not be available (HPET is high resolution but is not
> available in older machines, TSC tends to give unreliable results on
> machines that can do frequency scaling, PIT is slow to access etc.) - there
> seems to be comparison of them on
> http://evuraan.blogspot.com/2007_07_01_archive.html . Another example is
> that you can't do dynticks/nohz unless you also have high resolution timers.
>
> Both thread_cpu... and process_cpu... call posix_cpu_timer_create underneath
> so I don't really see that there is a difference between them (other than
> the timer's "type"). posix_cpu_timer_create is also called when the system
> has to do_cpu_nanosleep .
>
>> c.   since the hardware clock source is only a few possibility, what
>> their individual hardware infrastructure based on?   ie, all these
>> have ONE single hardware clock source?   WHY NOT? (resolution
>> differences?)
>
> I don't really understand this question. Underneath these are (probably) all
> being driven by the same clock hardware. The only difference is that some
> interfaces expose more features or always set a particular type for the
> timer event.
>


To rephrase my question:

In a standard x86 hardware system, we have hardware clock source from
APIC timer, ACPI timer, and then old 8253 PIT timer.   So my question
the different API listed above uses which hardware as the source of
clocking?   Then there is another HPET timer - is it synonymous to one
of the above timer?

Just googling a little bit:

http://www.oberle.org/apic_timer-timers.html

http://wiki.osdev.org/Programmable_Interval_Timer

http://www.oberle.org/apic_timer.html

After some search - I found this:

http://beos.mlotz.ch/documents/cpu_fix.html

>From within the writeup - I found the following echoing my question:

There is the PIT, the RTC, the APIC timer, the ACPI timer and recently
also the HPET was added. I will not explain them here as you can find
more details on the net.

But......er.....I have yet to find something useful on the
net....without wasting too much time....

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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