summaryrefslogtreecommitdiff
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorKnut Petersen <Knut_Petersen@t-online.de>2013-09-25 12:29:37 (GMT)
committerIngo Molnar <mingo@kernel.org>2013-10-04 08:06:07 (GMT)
commit723478c8a471403c53cf144999701f6e0c4bbd11 (patch)
treed89b59d4318eb5e37082f90880ac20b18f81a020 /kernel/sysctl.c
parent354cc40e3b0981c38ba2ce2964954480e6c03c37 (diff)
downloadlinux-723478c8a471403c53cf144999701f6e0c4bbd11.tar.xz
perf: Enforce 1 as lower limit for perf_event_max_sample_rate
/proc/sys/kernel/perf_event_max_sample_rate will accept negative values as well as 0. Negative values are unreasonable, and 0 causes a divide by zero exception in perf_proc_update_handler. This patch enforces a lower limit of 1. Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/5242DB0C.4070005@t-online.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index b2f06f3..2a9db91 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1049,6 +1049,7 @@ static struct ctl_table kern_table[] = {
.maxlen = sizeof(sysctl_perf_event_sample_rate),
.mode = 0644,
.proc_handler = perf_proc_update_handler,
+ .extra1 = &one,
},
{
.procname = "perf_cpu_time_max_percent",