public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* patch: sysctl.h (allocating new number)
@ 2002-01-25  7:15 Ulrich Windl
  2002-01-25 22:38 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Windl @ 2002-01-25  7:15 UTC (permalink / raw)
  To: linux-kernel

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch: sysctl.h (allocating new number)
  2002-01-25  7:15 patch: sysctl.h (allocating new number) Ulrich Windl
@ 2002-01-25 22:38 ` H. Peter Anvin
  2002-01-27 13:45   ` Martin Dalecki
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2002-01-25 22:38 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <3C51146F.6774.15F75C@localhost>
By author:    "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
In newsgroup: linux.dev.kernel
> 
> 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.
> 

I, for one, would definitely see the clock model merged into the
mainstream kernel.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch: sysctl.h (allocating new number)
  2002-01-25 22:38 ` H. Peter Anvin
@ 2002-01-27 13:45   ` Martin Dalecki
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Dalecki @ 2002-01-27 13:45 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

H. Peter Anvin wrote:

>Followup to:  <3C51146F.6774.15F75C@localhost>
>By author:    "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
>In newsgroup: linux.dev.kernel
>
>>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.
>>
>
>I, for one, would definitely see the clock model merged into the
>mainstream kernel.
>
>	-hpa
>
Amen to this!

I, for two, would definitely like to see it there as well!




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-01-27 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-25  7:15 patch: sysctl.h (allocating new number) Ulrich Windl
2002-01-25 22:38 ` H. Peter Anvin
2002-01-27 13:45   ` Martin Dalecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox