Skip to contentSkip to conversation

gc_min_interval in milleseconds via /proc (fwd)

PATCH Applied Robert Olsson 2 participants 4 messages Jan 27, 2005 – Feb 2, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 5 lines

David S. Miller wrote:

It would, but since this is a user visible API we really can't change it.

Ok! But I haven't heard of any successful use of this paticaul API. :-)

Quoted 3 lines

We could instead make another sysctl (perhaps name it something like "gc_min_interval_ms") to do what you propose, and then we'd keep the existing one around for compatibility.

All-right a new patch below.

					--ro
ipv4/route.c renamed from ipv4/route.c.orig +11 -0
@@ -2529,6 +2529,8 @@
 		.proc_handler	= &proc_dointvec,
 	},
 	{
+		/*  Deprecated. Use gc_min_interval_ms */
+ 
 		.ctl_name	= NET_IPV4_ROUTE_GC_MIN_INTERVAL,
 		.procname	= "gc_min_interval",
 		.data		= &ip_rt_gc_min_interval,
@@ -2538,6 +2540,15 @@
 		.strategy	= &sysctl_jiffies,
 	},
 	{
+		.ctl_name	= NET_IPV4_ROUTE_GC_MIN_INTERVAL,
+		.procname	= "gc_min_interval_ms",
+		.data		= &ip_rt_gc_min_interval,
+		.maxlen		= sizeof(unsigned long),
+		.mode		= 0644,
+		.proc_handler	= &proc_doulongvec_ms_jiffies_minmax,
+		.strategy	= &sysctl_jiffies,
+	},
+	{
 		.ctl_name	= NET_IPV4_ROUTE_GC_TIMEOUT,
 		.procname	= "gc_timeout",
 		.data		= &ip_rt_gc_timeout,
filesystems/proc.txt renamed from filesystems/proc.txt.orig +5 -4
@@ -1709,12 +1709,13 @@
 
 Writing to this file results in a flush of the routing cache.
 
-gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout,
-gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3
---------------------------------------------------------------
+gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh
+---------------------------------------------------------------------
 
 Values to  control  the  frequency  and  behavior  of  the  garbage collection
-algorithm for the routing cache.
+algorithm for the routing cache. gc_min_interval is deprecated and replaced
+by gc_min_interval_ms.
+
 
 max_size
 --------
maintainer
#1 lore raw
Quoted 1 line · On Thu, 27 Jan 2005 13:13:04 +0100 Robert Olsson <[email protected]>…

Ok! But I haven't heard of any successful use of this paticaul API. :-)

Are you really so sure?

Quoted 5 lines
Quoted 3 lines

We could instead make another sysctl (perhaps name it something like "gc_min_interval_ms") to do what you propose, and then we'd keep the existing one around for compatibility.

All-right a new patch below.

We must pick a new sysctl number too, for sysctl() system call. If the only access possible were through /proc then yes your change would be valid, but due to sysctl() system call the .ctl_name defines that dimension of the sysctl namespace.

#2 lore raw
Quoted 4 lines · David S. Miller

We must pick a new sysctl number too, for sysctl() system call. If the only access possible were through /proc then yes your change would be valid, but due to sysctl() system call the .ctl_name defines that dimension of the sysctl namespace.

Ok!
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS was added last in list to avoid renumbering. Feel free to change.

					--ro
linux/sysctl.h renamed from linux/sysctl.h.orig +1 -0
@@ -365,6 +365,7 @@
 	NET_IPV4_ROUTE_MIN_PMTU=16,
 	NET_IPV4_ROUTE_MIN_ADVMSS=17,
 	NET_IPV4_ROUTE_SECRET_INTERVAL=18,
+	NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19
 };
 
 enum
ipv4/route.c renamed from ipv4/route.c.orig +11 -0
@@ -2529,6 +2529,8 @@
 		.proc_handler	= &proc_dointvec,
 	},
 	{
+		/*  Deprecated. Use gc_min_interval_ms */
+ 
 		.ctl_name	= NET_IPV4_ROUTE_GC_MIN_INTERVAL,
 		.procname	= "gc_min_interval",
 		.data		= &ip_rt_gc_min_interval,
@@ -2538,6 +2540,15 @@
 		.strategy	= &sysctl_jiffies,
 	},
 	{
+		.ctl_name	= NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
+		.procname	= "gc_min_interval_ms",
+		.data		= &ip_rt_gc_min_interval,
+		.maxlen		= sizeof(unsigned long),
+		.mode		= 0644,
+		.proc_handler	= &proc_doulongvec_ms_jiffies_minmax,
+		.strategy	= &sysctl_jiffies,
+	},
+	{
 		.ctl_name	= NET_IPV4_ROUTE_GC_TIMEOUT,
 		.procname	= "gc_timeout",
 		.data		= &ip_rt_gc_timeout,
filesystems/proc.txt renamed from filesystems/proc.txt.orig +5 -4
@@ -1709,12 +1709,13 @@
 
 Writing to this file results in a flush of the routing cache.
 
-gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout,
-gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3
---------------------------------------------------------------
+gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh
+---------------------------------------------------------------------
 
 Values to  control  the  frequency  and  behavior  of  the  garbage collection
-algorithm for the routing cache.
+algorithm for the routing cache. gc_min_interval is deprecated and replaced
+by gc_min_interval_ms.
+
 
 max_size
 --------
maintainer Applied
#3 lore raw
Quoted 10 lines · On Mon, 31 Jan 2005 19:01:05 +0100 Robert Olsson <[email protected]>…
Quoted 4 lines · David S. Miller

We must pick a new sysctl number too, for sysctl() system call. If the only access possible were through /proc then yes your change would be valid, but due to sysctl() system call the .ctl_name defines that dimension of the sysctl namespace.

Ok!
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS was added last in list to avoid renumbering. Feel free to change.

Applied, thanks Robert.