LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-24-2011, 02:55 AM   #1
begroup
LQ Newbie
 
Registered: Jan 2011
Posts: 6

Rep: Reputation: 0
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
 
Old 01-24-2011, 08:23 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,995

Rep: Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327Reputation: 4327
Quote:
Originally Posted by begroup View Post
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.
 
Old 01-24-2011, 08:43 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to add a new clocksource? Rushis Linux - Embedded & Single-board computer 1 08-20-2010 02:03 PM
Clocksource tsc unstable(delta = -75444992 ns) haribabu1836 Linux - Software 1 04-06-2010 09:22 AM
Check available clocksource? kushalkoolwal Linux - Kernel 2 02-22-2010 02:56 PM
Clocksource tsc unstable sampoo55 Linux - General 1 07-25-2009 09:46 AM
Clocksource tsc unstable punt Fedora 11 12-29-2008 03:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration