* [RFC] HZ entry in /proc/sys/kernel
@ 2003-05-26 11:53 Grzegorz Jaskiewicz
2003-05-26 12:15 ` Arjan van de Ven
0 siblings, 1 reply; 4+ messages in thread
From: Grzegorz Jaskiewicz @ 2003-05-26 11:53 UTC (permalink / raw)
To: lkml; +Cc: Jens Axboe
I have seen few scripts allready that are assuming HZ==100.
Afaik this value is different in 2.5/2.4 for the same arch.
So is it worth to add on both simple /proc/sys/kernel/HZ ?
Simple patch for 2.4.21-rc3 , if it is allright i will do same thing for
2.5
----------------------------------------------------------
diff -ur 2/include/linux/sysctl.h 1/include/linux/sysctl.h
--- 2/include/linux/sysctl.h 2003-05-24 12:10:35.000000000 +0100
+++ 1/include/linux/sysctl.h 2003-05-26 12:44:16.000000000 +0100
@@ -125,6 +125,7 @@
KERN_TAINTED=53, /* int: various kernel tainted flags */
KERN_CADPID=54, /* int: PID of the process to notify on
CAD */
KERN_CORE_PATTERN=56, /* string: pattern for core-files */
+ KERN_HZ=57, /* int: HZ value */
};
diff -ur 2/kernel/sysctl.c 1/kernel/sysctl.c
--- 2/kernel/sysctl.c 2003-05-26 12:33:37.000000000 +0100
+++ 1/kernel/sysctl.c 2003-05-26 12:45:31.000000000 +0100
@@ -32,6 +32,7 @@
#include <linux/highuid.h>
#include <asm/uaccess.h>
+#include <asm/param.h>
#ifdef CONFIG_ROOT_NFS
#include <linux/nfs_fs.h>
@@ -123,6 +124,8 @@
#ifdef CONFIG_PROC_FS
+static unsigned int hz=HZ;
+
static ssize_t proc_readsys(struct file *, char *, size_t, loff_t *);
static ssize_t proc_writesys(struct file *, const char *, size_t,
loff_t *);
static int proc_sys_permission(struct inode *, int);
@@ -244,6 +247,8 @@
0600, NULL, &proc_dointvec},
{KERN_MAX_THREADS, "threads-max", &max_threads, sizeof(int),
0644, NULL, &proc_dointvec},
+ {KERN_HZ, "HZ", &hz, sizeof(unsigned int),
+ 0444, NULL, &proc_dointvec},
{KERN_RANDOM, "random", NULL, 0, 0555, random_table},
{KERN_OVERFLOWUID, "overflowuid", &overflowuid, sizeof(int),
0644, NULL,
&proc_dointvec_minmax, &sysctl_intvec, NULL,
--
Grzegorz Jaskiewicz <gj@pointblue.com.pl>
K4 labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HZ entry in /proc/sys/kernel
2003-05-26 11:53 [RFC] HZ entry in /proc/sys/kernel Grzegorz Jaskiewicz
@ 2003-05-26 12:15 ` Arjan van de Ven
2003-05-27 19:39 ` Daniele
0 siblings, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2003-05-26 12:15 UTC (permalink / raw)
To: Grzegorz Jaskiewicz; +Cc: lkml, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Mon, 2003-05-26 at 13:53, Grzegorz Jaskiewicz wrote:
> I have seen few scripts allready that are assuming HZ==100.
> Afaik this value is different in 2.5/2.4 for the same arch.
No it's not actually.
The userspace interface is constant/stable and in units of HZ=100 even
though the kernel HZ might be different.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HZ entry in /proc/sys/kernel
2003-05-26 12:15 ` Arjan van de Ven
@ 2003-05-27 19:39 ` Daniele
2003-05-27 19:42 ` Arjan van de Ven
0 siblings, 1 reply; 4+ messages in thread
From: Daniele @ 2003-05-27 19:39 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: linux-kernel
On Mon, May 26, 2003 at 02:15:57PM +0200, Arjan van de Ven wrote:
> On Mon, 2003-05-26 at 13:53, Grzegorz Jaskiewicz wrote:
> > I have seen few scripts allready that are assuming HZ==100.
> > Afaik this value is different in 2.5/2.4 for the same arch.
>
> No it's not actually.
> The userspace interface is constant/stable and in units of HZ=100 even
> though the kernel HZ might be different.
>
What's this HZ value related to?
cheers,
Daniele
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] HZ entry in /proc/sys/kernel
2003-05-27 19:39 ` Daniele
@ 2003-05-27 19:42 ` Arjan van de Ven
0 siblings, 0 replies; 4+ messages in thread
From: Arjan van de Ven @ 2003-05-27 19:42 UTC (permalink / raw)
To: Daniele; +Cc: Arjan van de Ven, linux-kernel
On Tue, May 27, 2003 at 09:39:57PM +0200, Daniele wrote:
> On Mon, May 26, 2003 at 02:15:57PM +0200, Arjan van de Ven wrote:
> > On Mon, 2003-05-26 at 13:53, Grzegorz Jaskiewicz wrote:
> > > I have seen few scripts allready that are assuming HZ==100.
> > > Afaik this value is different in 2.5/2.4 for the same arch.
> >
> > No it's not actually.
> > The userspace interface is constant/stable and in units of HZ=100 even
> > though the kernel HZ might be different.
> >
>
> What's this HZ value related to?
the userspace interface is not in units of kernel HZ, but in
"theoretical time units that happen to match a defined
default" which happens to match 10ms on x86.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-27 19:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-26 11:53 [RFC] HZ entry in /proc/sys/kernel Grzegorz Jaskiewicz
2003-05-26 12:15 ` Arjan van de Ven
2003-05-27 19:39 ` Daniele
2003-05-27 19:42 ` Arjan van de Ven
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.