diff mbox

[v2,2/2] posix-timers: Exposes DELAYTIMER_MAX constant used to govern overruns

Message ID 1422121737-3686-3-git-send-email-dchurch@andplus.com
State New
Headers show

Commit Message

Daniel Church Jan. 24, 2015, 5:48 p.m. UTC
POSIX.1-2001 specification of timer_getoverrun() supports constant
DELAYTIMER_MAX which prevents overflow and caps overrun count.  Exposes
delaytimer_max value to userland via /proc/sys/kernel/delaytimer_max such
that GLIBC can support DELAYTIMER_MAX constant.

Signed-off-by: Daniel Church <dchurch@andplus.com>
---
 kernel/sysctl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thomas Gleixner Jan. 24, 2015, 7:20 p.m. UTC | #1
On Sat, 24 Jan 2015, Daniel Church wrote:

> POSIX.1-2001 specification of timer_getoverrun() supports constant
> DELAYTIMER_MAX which prevents overflow and caps overrun count.  Exposes
> delaytimer_max value to userland via /proc/sys/kernel/delaytimer_max such

I know that you try to match the posix name, but when looking at the
prctl w/o knowing about DELAYTIMER_MAX, it's non intuitive.

Something like posixtimer_max_overruns or if you insist on the
delaytimer_max part, then let us prepend it with posixtimer_ at least.

New prctls require an update of Documentation/sysctl/kernel.txt.

Thanks,

	tglx
Carlos O'Donell Jan. 24, 2015, 7:36 p.m. UTC | #2
On 01/24/2015 02:20 PM, Thomas Gleixner wrote:
> On Sat, 24 Jan 2015, Daniel Church wrote:
> 
>> POSIX.1-2001 specification of timer_getoverrun() supports constant
>> DELAYTIMER_MAX which prevents overflow and caps overrun count.  Exposes
>> delaytimer_max value to userland via /proc/sys/kernel/delaytimer_max such
> 
> I know that you try to match the posix name, but when looking at the
> prctl w/o knowing about DELAYTIMER_MAX, it's non intuitive.
> 
> Something like posixtimer_max_overruns or if you insist on the
> delaytimer_max part, then let us prepend it with posixtimer_ at least.
> 
> New prctls require an update of Documentation/sysctl/kernel.txt.

Agreed, the name should be self-explanatory and point at POSIX.

The documentation should be detailed and explain exactly what this
is for, what are valid values, and why you would ever want to change
them.

Cheers,
Carlos.
diff mbox

Patch

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 137c7f6..b283808 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -63,6 +63,7 @@ 
 #include <linux/binfmts.h>
 #include <linux/sched/sysctl.h>
 #include <linux/kexec.h>
+#include <linux/posix-timers.h>
 
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -761,6 +762,13 @@  static struct ctl_table kern_table[] = {
 	},
 #endif
 	{
+		.procname	= "delaytimer_max",
+		.data		= &delaytimer_max,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec,
+	},
+	{
 		.procname	= "pid_max",
 		.data		= &pid_max,
 		.maxlen		= sizeof (int),