Skip to contentSkip to conversation

nfs: sysctl's should use USER_HZ not HZ

PATCH In review Stephen Hemminger 1 participant 2 messages Jul 1, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: sysctl's should use USER_HZ not HZ

There is no good way to tell what the internal value of kernel HZ is from userspace, so all administrative interfaces are supposed to use either USER_HZ (100) or other absolute time units. Two of the NFS sysctl values are still using HZ, and can be simply converted to USER_HZ.

fs/nfs/sysctl.c +2 -2
@@ -37,7 +37,7 @@ static ctl_table nfs_cb_sysctls[] = {
 		.data = &nfs_idmap_cache_timeout,
 		.maxlen = sizeof(int),
 		.mode = 0644,
-		.proc_handler = &proc_dointvec_jiffies,
+		.proc_handler = &proc_dointvec_userhz_jiffies,
 		.strategy = &sysctl_jiffies,
 	},
 #endif
@@ -47,7 +47,7 @@ static ctl_table nfs_cb_sysctls[] = {
 		.data		= &nfs_mountpoint_expiry_timeout,
 		.maxlen		= sizeof(nfs_mountpoint_expiry_timeout),
 		.mode		= 0644,
-		.proc_handler	= &proc_dointvec_jiffies,
+		.proc_handler	= &proc_dointvec_userhz_jiffies,
 		.strategy	= &sysctl_jiffies,
 	},
 	{
#1 lore raw
Quoted 19 lines · On Tue, 1 Jul 2008 11:44:29 -0700 Stephen Hemminger…

There is no good way to tell what the internal value of kernel HZ is from userspace, so all administrative interfaces are supposed to use either USER_HZ (100) or other absolute time units. Two of the NFS sysctl values are still using HZ, and can be simply converted to USER_HZ.

fs/nfs/sysctl.c +1 -1
@@ -37,7 +37,7 @@ static ctl_table nfs_cb_sysctls[] = {
 		.data = &nfs_idmap_cache_timeout,
 		.maxlen = sizeof(int),
 		.mode = 0644,
-		.proc_handler = &proc_dointvec_jiffies,
+		.proc_handler = &proc_dointvec_userhz_jiffies,
 		.strategy = &sysctl_jiffies,
 	},
 #endif

fs/nfs/sysctl.c static ctl_table nfs_cb_sysctls[] = { · line 53

Quoted 8 lines
fs/nfs/sysctl.c +1 -1
@@ -47,7 +47,7 @@ static ctl_table nfs_cb_sysctls[] = {
 		.data		= &nfs_mountpoint_expiry_timeout,
 		.maxlen		= sizeof(nfs_mountpoint_expiry_timeout),
 		.mode		= 0644,
-		.proc_handler	= &proc_dointvec_jiffies,
+		.proc_handler	= &proc_dointvec_userhz_jiffies,
 		.strategy	= &sysctl_jiffies,
 	},
 	{

Never mind... proc_dointvec_jiffies converts to/from seconds.