From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,2b5b42cf15df34a1 X-Google-Attributes: gid111c93,public From: Nils Faerber Subject: Re: What is HZ value for? Date: 1999/12/22 Message-ID: <38609b0d@rainbow.hrz.uni-siegen.de>#1/1 X-Deja-AN: 564114768 References: X-Trace: 22 Dec 1999 10:34:05 +0100, vmax.unix-ag.uni-siegen.de User-Agent: tin/pre-1.4-19990624 ("Dawnrazor") (UNIX) (AIX/4-2) Newsgroups: comp.os.linux.alpha Kyu Rang Kim wrote: : Hi, Hello! : I'm using redhat alphalinux 6.0 with all security fixes applied. : Kernel version is 2.2.5-22 that was recompiled by myself. : As of uptime from 48 days, I got some unusual messages when executing : 'ps' or 'top' like this: : $ ps : Unknown HZ value! (2027) Assume 1024. : PID TTY TIME CMD : 19426 pts/0 00:00:03 bash : 13566 pts/0 00:00:00 ps Err ... how on earth could this be changed? Some userspace program must have changed the envrionment variable HZ. : Whis is HZ value and why this phenomenon happen? : Is there any side-effect of "Unknown HZ value"? The HZ value gives the number of timer interrupts per second. This is the base for all time measurements in the system. On most systems the clock ticks at 100Hz (like on i386) but the Alphas use to have 1024Hz. On the one hand this gives somewhat better responsivenes because the scheduler is also dependant on clock ticks and so gets called more often on the other this causes from drivers to fail. Some programmers use clock ticks to measure time directly in their drivers. In kernel this can simply be done by using the variable 'jifffies' which is in fact a timer tick counter. If you then do not take into account the HZ value your time measurement is false on all systems that do not share your HZ value. One example is/was the MIDI driver on Alphas. MIDI uses a similar timing scheme with MIDI-ticks. Those are derived from the system ticks. If a program now wants to time events it may ask the MIDI layer how many ticks there are per second. If it does not do so it will only work on any system which has the same MIDI-tick value as the development system. One bad example for this is xmp a MOD file player which can use a wavetable card like the SB AWE cards. It plays ten times faster on Alphas than on ix86 because it relies on the assumption that there are 100 ticks per second ;) A patched version of xmp can be found here: http://www.home.unix-ag.org/nils/Alpha/Packages/index.html : ### Kyu Rang Kim ### http://i.am/krkim ### ICQ:27474092 ### CU nils -- Nils Faerber (Linux Nils) eMail: nils@unix-ag.org Student of computer science http://www.si.unix-ag.org/~nils/ Unix user group, University of Siegen, Germany Siegen ... the arctic rain forest! --