LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set TSC as a clocksource (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-tsc-as-a-clocksource-858278/)

begroup 01-24-2011 02:55 AM

How to set TSC as a clocksource
 
Hello all,
We are working on ubuntu10.04.
Currently it is using jiffies as a clocksource.
We want to set it to TSC.
How should we proceed ?
Also we are working on libpcap and we want to enhance it for that we want to enable MMAP support.
How should we do that?

Waiting for the reply.

Thank you

TB0ne 01-24-2011 08:23 AM

Quote:

Originally Posted by begroup (Post 4235709)
Hello all,
We are working on ubuntu10.04. Currently it is using jiffies as a clocksource.
We want to set it to TSC. How should we proceed ?

You could change /sys/devices/system/clocksource/clocksource0/available_clocksource and set it only to tsc, but that's a bad idea. TSC is NOT an accurate time reference. From some reference material:
Code:

tsc is part of your actual CPU.  I don't know what tsc was really meant for when designed, but it's a poor choice for timer when time
accuracy is important, because, well, it's simply not accurate.  When my system was using tsc, I would notice time drift of almost 1
minute every hour.  This seems to be considered 'ok' by people because you can just configure your computer to adjust clock daily with
ntp. Asside from the problem that tsc time will drift depending on your system load, if you have a multi-core system, tsc will drift
from itself on different cores.  Some multi-core cpu's will synchronize tsc (I think the Intel Core 2 series, for example, but don't
quote me),, whereas other CPU's will lead to tsc being unstable and the system switching to something else.  (although, this should
all happen automagically, a system throwing a hairball over it should be considered a bug.)

Quote:

Also we are working on libpcap and we want to enhance it for that we want to enable MMAP support. How should we do that?
Waiting for the reply.
Thank you
Ok...then a brief Google search turns up a patch for libpcap that was released back in 2008:
http://www.mail-archive.com/tcpdump-.../msg03599.html

May already be present in what you've got...if not, the instructions for applying the patch are easily found.

H_TeXMeX_H 01-24-2011 08:43 AM

I agree, TSC is not a good choice, it seems it was being used by default on my computer and the time went off really quick. See:
http://www.kernel.org/doc/Documentat...parameters.txt

Code:

    clocksource=    Override the default clocksource
            Format: <string>
            Override the default clocksource and use the clocksource
            with the name specified.
            Some clocksource names to choose from, depending on
            the platform:
            [all] jiffies (this is the base, fallback clocksource)
            [ACPI] acpi_pm
            [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
                pxa_timer,timer3,32k_counter,timer0_1
            [AVR32] avr32
            [X86-32] pit,hpet,tsc;
                scx200_hrt on Geode; cyclone on IBM x440
            [MIPS] MIPS
            [PARISC] cr16
            [S390] tod
            [SH] SuperH
            [SPARC64] tick
            [X86-64] hpet,tsc

I currently use hpet, because it's the only one left for x86_64, and it works quite well.


All times are GMT -5. The time now is 12:32 PM.