public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grzegorz Jaskiewicz <gj@pointblue.com.pl>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Jens Axboe <axboe@suse.de>
Subject: [RFC] HZ entry in /proc/sys/kernel
Date: 26 May 2003 12:53:52 +0100	[thread overview]
Message-ID: <1053950030.2028.4.camel@nalesnik.localhost> (raw)

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


             reply	other threads:[~2003-05-26 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26 11:53 Grzegorz Jaskiewicz [this message]
2003-05-26 12:15 ` [RFC] HZ entry in /proc/sys/kernel Arjan van de Ven
2003-05-27 19:39   ` Daniele
2003-05-27 19:42     ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1053950030.2028.4.camel@nalesnik.localhost \
    --to=gj@pointblue.com.pl \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox