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: Kyu Rang Kim Subject: Re: What is HZ value for? Date: 1999/12/23 Message-ID: #1/1 X-Deja-AN: 564201678 References: <38609b0d@rainbow.hrz.uni-siegen.de> Organization: Seoul National University, Republic of Korea Newsgroups: comp.os.linux.alpha Nils Faerber writes: > 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. Can the HZ variable be changed by a userspace program? Then can it be mean that my system was compromised by a malicious program or by a cracker? Anyway, I have no environment variable named HZ... $ env | grep HZ $ Today (or yesterday?), the HZ value seems to get back to a normal one. $ uptime 11:11pm up 51 days, 2:16, 18 users, load average: 1.00, 1.05, 1.29 $ ps PID TTY TIME CMD 24537 pts/24 00:00:00 bash 25270 pts/24 00:00:00 ps I think there are some bugs inside the kernel regarding the HZ value. But, except the odd message with 'ps' or 'top' above, I did not feel any difference between 'normal' and 'odd' HZ values. (I do not have a sound card) In conclusion, the HZ value of Linux alpha kernel 2.2.5 changed to an odd one between 48 and 51 days of uptime without any noticible malfunction of the system except the unusual messages with 'ps' or 'top'. > : 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 > Nils Faerber (Linux Nils) eMail: nils@unix-ag.org Thanks for your illustrative explanation on HZ value. -- ### Kyu Rang Kim ### http://i.am/krkim ### ICQ:27474092 ### # Plant Disease Epidemiology Lab. Seoul National University # Suwon Korea, TEL: +82-50-2580-9991 FAX: +82-331-294-1464