[RFC PATCH v1 3/6] ktask: add /proc/sys/debug/ktask_max_threads

From: daniel . m . jordan
Date: Fri Jul 14 2017 - 18:17:11 EST


Adds a proc file to control the maximum number of ktask threads in use
for any one job. Its primary use is to aid in debugging.

Signed-off-by: Daniel Jordan <daniel.m.jordan@xxxxxxxxxx>
---
kernel/sysctl.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4dfba1a..7fe142b 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -67,6 +67,7 @@
#include <linux/kexec.h>
#include <linux/bpf.h>
#include <linux/mount.h>
+#include <linux/ktask_internal.h>

#include <linux/uaccess.h>
#include <asm/processor.h>
@@ -1850,6 +1851,15 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
.extra2 = &one,
},
#endif
+#if defined(CONFIG_KTASK)
+ {
+ .procname = "ktask_max_threads",
+ .data = &ktask_max_threads,
+ .maxlen = sizeof(ktask_max_threads),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+#endif
{ }
};

--
1.7.1