From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
To: linux-kernel@vger.kernel.org
Subject: patch: sysctl.h (allocating new number)
Date: Fri, 25 Jan 2002 08:15:24 +0100 [thread overview]
Message-ID: <3C51146F.6774.15F75C@localhost> (raw)
[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 2350 bytes --]
Hello,
I have attached a patch (1kB) against sysctl.h of 2.4.16. The patch
allocates a new number for a directory /proc/sys/kernel/time.
I use that sysctl in the kernel add-on named PPSkit for some time now
(since 2.2.13). However as the number was never officially allocated, I
had to change it from 42 to 50, and from 50 to 55 for 2.4.16.
Therefore I'd like to allocate the number permanently.
So is there any benefit? Yes, because there's a problem with
adjtimex(). Historically it was a bad design descision to use one
adjtimex() to implement three different routines:
1) adjtime()
2) ntp_adjtime(), ntp_gettime()
3) controlling internal kernel variables like ``tick''
Actually the current implementation is a cul de sac: The current
reference implementation for the NTP routines uses the same bit
patterns as some Linux-specific extensions to adjtimex(). Partially
it's possible to remap the bits in the kernel to do a new
implementation, but sysctl is the better way to do it.
I have implemented sysctl extensions to read/write the ``tick'' and
slew rate of adjtime() (among others) for my new kernel clock model
using nanoseconds (PPSkit-2.0.1). If there's demand to a back-merge to
the main stream sources, plese say what you would like. As the project
was sponsored a little bit recently, I'm willing to donate a few
working hours for that.
The sysctl part looks like this (older kernel):
tick1b:/proc/sys/kernel/time # ll
total 0
dr-xr-xr-x 2 root root 0 Jan 25 08:10 .
dr-xr-xr-x 3 root root 0 Jan 25 08:10 ..
-r--r--r-- 1 root root 0 Jan 25 08:10 pps
-rw-r--r-- 1 root root 0 Jan 25 08:10
rtc_runs_localtime
-rw-r--r-- 1 root root 0 Jan 25 08:10 rtc_update
-rw-r--r-- 1 root root 0 Jan 25 08:10 tickadj
-rw-r--r-- 1 root root 0 Jan 25 08:10 time_tick
-rw-r--r-- 1 root root 0 Jan 25 08:10 timezone
Except for the first entry (experimental for debugging) the contents
are:
0 (rtc_runs_localtime)
660 (rtc_update)
500000 (tickadj [ns])
10000000 (time_tick [ns])
-60 0 (timezone)
IMHO it's time to make a turn in the cul de sac before the truck hits
the end of the road.
Regards
Ulrich
NOTE: Not subscribed to linux-kernel, so make sure that I'll get your
replies...
[-- Attachment #2: Text from file 'sysctl.h.diff' --]
[-- Type: text/plain, Size: 979 bytes --]
Index: include/linux/sysctl.h
===================================================================
RCS file: /root/LinuxCVS/Kernel/include/linux/sysctl.h,v
retrieving revision 1.1.1.6
retrieving revision 1.1.1.6.2.1
diff -u -r1.1.1.6 -r1.1.1.6.2.1
--- include/linux/sysctl.h 2001/12/13 18:56:49 1.1.1.6
+++ include/linux/sysctl.h 2001/12/29 14:59:21 1.1.1.6.2.1
@@ -124,8 +124,19 @@
KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
KERN_TAINTED=53, /* int: various kernel tainted flags */
KERN_CADPID=54, /* int: PID of the process to notify on CAD */
+ KERN_TIME=55, /* directory: time */
};
+/* KERN_TIME names: */
+enum
+{
+ KERN_TIME_TIMEZONE=1, /* struct: timezone */
+ KERN_TIME_RTC_UPDATE=2, /* int: rtc_update */
+ KERN_TIME_RTC_RUNS_LOCALTIME=3, /* int: rtc_runs_localtime */
+ KERN_TIME_TIME_TICK=4, /* int: time_tick */
+ KERN_TIME_TICKADJ=5, /* int: tickadj */
+ KERN_TIME_PPS_VAR=99, /* struct pps_var: pps */
+};
/* CTL_VM names: */
enum
next reply other threads:[~2002-01-25 7:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-25 7:15 Ulrich Windl [this message]
2002-01-25 22:38 ` patch: sysctl.h (allocating new number) H. Peter Anvin
2002-01-27 13:45 ` Martin Dalecki
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=3C51146F.6774.15F75C@localhost \
--to=ulrich.windl@rz.uni-regensburg.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