summaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2015-04-16 12:47:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:07 -0400
commit16db3d3f1170fb0efca652c9378ce7c5f5cb4232 (patch)
treef85f846c4e8a4761449aeca34dbd1055bb693828 /kernel/sysctl.c
parentac1b398de1ef94aeee8ba87b0120763526572a6e (diff)
downloadop-kernel-dev-16db3d3f1170fb0efca652c9378ce7c5f5cb4232.zip
op-kernel-dev-16db3d3f1170fb0efca652c9378ce7c5f5cb4232.tar.gz
kernel/sysctl.c: threads-max observe limits
Users can change the maximum number of threads by writing to /proc/sys/kernel/threads-max. With the patch the value entered is checked against the same limits that apply when fork_init is called. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 42b7fc2..3c09984 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -93,11 +93,9 @@
#include <linux/nmi.h>
#endif
-
#if defined(CONFIG_SYSCTL)
/* External variables not in a header file. */
-extern int max_threads;
extern int suid_dumpable;
#ifdef CONFIG_COREDUMP
extern int core_uses_pid;
@@ -710,10 +708,10 @@ static struct ctl_table kern_table[] = {
#endif
{
.procname = "threads-max",
- .data = &max_threads,
+ .data = NULL,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec,
+ .proc_handler = sysctl_max_threads,
},
{
.procname = "random",
OpenPOWER on IntegriCloud