LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-12-2012, 01:22 AM   #1
gdkool
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Rep: Reputation: 0
How linux kernel adapts to underlying processor frequency while calculating time?


I am running openWRT on a virtual machine on a host running Windows XP and having AMD tm 1.6 GHz processor. I observed that clock on virtual machine is running fast such that a "sleep 10" returns in less than 10 seconds (around 7-8 seconds). The current value of HZ selected during build time is 100.

Since, this is a virtual machine, and underlying hardware will keep on changing, I want to understand how linux kernel adapts with the changing processor frequency during run time while calculating time. For example, 1 second will always be equal on a kernel image whether it is running over 700 MHz Pentium processor or 1.6 GHz AMD processor .
 
Old 11-12-2012, 08:15 PM   #2
jefro
Guru
 
Registered: Mar 2008
Posts: 11,521

Rep: Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404
Real time clock and how the system cpu is generally not the same and hasn't been since xt's. As to why this is wrong on your setup, I'd guess some setting is off or the emulator is off or what not.

Maybe this image you have was made for a device that doesn't ever change cpu speeds or the device doesn't contain a real time clock.
 
Old 11-13-2012, 02:23 AM   #3
gdkool
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
Real time clock and how the system cpu is generally not the same and hasn't been since xt's. As to why this is wrong on your setup, I'd guess some setting is off or the emulator is off or what not.

Maybe this image you have was made for a device that doesn't ever change cpu speeds or the device doesn't contain a real time clock.
This setup is a virtual machine (running openWRT Linux on VMware Player). So, I guess, it will utilize the hardware resources of the underlying host system. I could read /proc/cpuinfo to contain the details (processor etc.) of my host machine.

Could you point me to the settings which should be altered so that the image adjusts its clock according to the underlying hardware (which I thought should have been done by default)?
 
  


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
unix command to find processor frequency in solaris 10 pm25 Solaris / OpenSolaris 7 10-05-2011 03:51 PM
Processor frequency change rapa Linux - Embedded & Single-board computer 3 09-19-2011 06:10 AM
gettimeofday() - execution time and underlying implementation details cagri_balkesen Linux - Kernel 1 02-08-2009 01:27 PM
Processor clock frequency killi Linux - Hardware 7 02-07-2006 02:12 PM


All times are GMT -5. The time now is 01:25 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration