Re: How to modify uptime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Erik,

After making the following changes in  kernel/Kconfig.hz and again after rebuilding and booting from this
newly configured kernel, i still get the same HZ value.
<snip>
#
# Timer Interrupt Frequency Configuration
#

choice
        prompt "Timer frequency"
        default HZ_10000 <====
----
----
config HZ
        int
        default 100 if HZ_100
        default 250 if HZ_250
        default 300 if HZ_300
        default 1000 if HZ_1000
        default 10000 if HZ_10000

<snip>

Though the customer is having 2.4 kernel,but i was giving a try on 2.6 first(because the building
procedure failed,seems to be due to a higher version of gcc, and as i didn't had
and i just checked that the same file ,i.e. kernel/Kconfig.hz is not available for 2.4
~amit

On Jan 10, 2008 3:02 PM, Erik Mouw <mouw@xxxxxxxxxxxx> wrote:
On Thu, Jan 10, 2008 at 02:31:46PM +0530, amit mehta wrote:
> One of our customer is facing an issue with jiffies wrap up.
> on a 32 bit machine, the variable jiffies count upto 472 days.
> the customer's server was up for 472 days ('uptime') and to reproduce
> the same, i tried to tweak with the variable HZ in
> linux-2.6..23.9/include/asm-i386/param.h
> but it seems that it is not working(i may be doing something stupid as well)

Problems with jiffies wrapup shouldn't happen with 2.6 kernels anymore
because jiffies is initialised at a couple of minutes before wrap up.
That shook out quite some jiffies wrap up bugs.

> i changed HZ from 100 to 10000 in linux-2.6..23.9/include/asm-i386/param.h .

Better do it in kernel/Kconfig.hz

> Then after rebuilding the kernel.and booting from it
> i inserted a small module to read the jiffies and HZ global variable( i
> don't know if there is any user level command to read the same) ,which is as
> follows:
>
> [root@localhost drivers]# cat get_jiffies.c
> #include <linux/init.h>
> #include <linux/module.h>
> #include <asm/current.h>
> #include <linux/sched.h>
> #include <linux/time.h>
> #include <linux/jiffies.h>
> static int __init jiffies_init(void)
> {
> unsigned long j,z;
> j = z = 0;
> j = jiffies;
> z = HZ;
> printk(KERN_ALERT "jiffies value is %lu\n",j);
> printk(KERN_ALERT "jiffies value in seconds %lu\n",(jiffies/HZ));
> printk(KERN_ALERT "HZ value is %lu\n",z);
> return 0;
> }
>
> static void __exit jiffies_exit(void)
> {
> printk(KERN_ALERT "Goodbye, world!\n");
> }
>
> module_init(jiffies_init);
> module_exit(jiffies_exit);
>
> MODULE_LICENSE("GPL");
>
> [root@localhost drivers]# insmod get_jiffies.ko
> [root@localhost drivers]# dmesg
> jiffies value is 372939
> jiffies value in seconds 1491
> HZ value is 250 <====
>
> why this HZ variable is shown as 250 ?

Because it is overridden from kernel/Kconfig.hz .


Erik

--
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHheYT/PlVHJtIto0RAuA4AJ9OF7Xm5ruqBsFZl2iMvvWVTwYbygCfdcz2
AiaUwSosu2zo/p667iO5XvU=
=Z6d5
-----END PGP SIGNATURE-----



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux