aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c63
1 files changed, 57 insertions, 6 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3d56fe7570da..92f6e5bc3c24 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -87,10 +87,6 @@ extern int rcutorture_runnable;
87#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ 87#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
88 88
89/* Constants used for minimum and maximum */ 89/* Constants used for minimum and maximum */
90#if defined(CONFIG_HIGHMEM) || defined(CONFIG_DETECT_SOFTLOCKUP)
91static int one = 1;
92#endif
93
94#ifdef CONFIG_DETECT_SOFTLOCKUP 90#ifdef CONFIG_DETECT_SOFTLOCKUP
95static int sixty = 60; 91static int sixty = 60;
96static int neg_one = -1; 92static int neg_one = -1;
@@ -101,6 +97,7 @@ static int two = 2;
101#endif 97#endif
102 98
103static int zero; 99static int zero;
100static int one = 1;
104static int one_hundred = 100; 101static int one_hundred = 100;
105 102
106/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ 103/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
@@ -121,6 +118,10 @@ extern int sg_big_buff;
121#include <asm/system.h> 118#include <asm/system.h>
122#endif 119#endif
123 120
121#ifdef CONFIG_SPARC64
122extern int sysctl_tsb_ratio;
123#endif
124
124#ifdef __hppa__ 125#ifdef __hppa__
125extern int pwrsw_enabled; 126extern int pwrsw_enabled;
126extern int unaligned_enabled; 127extern int unaligned_enabled;
@@ -451,6 +452,16 @@ static struct ctl_table kern_table[] = {
451 .proc_handler = &proc_dointvec, 452 .proc_handler = &proc_dointvec,
452 }, 453 },
453#endif 454#endif
455#ifdef CONFIG_SPARC64
456 {
457 .ctl_name = CTL_UNNUMBERED,
458 .procname = "tsb-ratio",
459 .data = &sysctl_tsb_ratio,
460 .maxlen = sizeof (int),
461 .mode = 0644,
462 .proc_handler = &proc_dointvec,
463 },
464#endif
454#ifdef __hppa__ 465#ifdef __hppa__
455 { 466 {
456 .ctl_name = KERN_HPPA_PWRSW, 467 .ctl_name = KERN_HPPA_PWRSW,
@@ -487,6 +498,26 @@ static struct ctl_table kern_table[] = {
487 .proc_handler = &ftrace_enable_sysctl, 498 .proc_handler = &ftrace_enable_sysctl,
488 }, 499 },
489#endif 500#endif
501#ifdef CONFIG_STACK_TRACER
502 {
503 .ctl_name = CTL_UNNUMBERED,
504 .procname = "stack_tracer_enabled",
505 .data = &stack_tracer_enabled,
506 .maxlen = sizeof(int),
507 .mode = 0644,
508 .proc_handler = &stack_trace_sysctl,
509 },
510#endif
511#ifdef CONFIG_TRACING
512 {
513 .ctl_name = CTL_UNNUMBERED,
514 .procname = "ftrace_dump_on_oops",
515 .data = &ftrace_dump_on_oops,
516 .maxlen = sizeof(int),
517 .mode = 0644,
518 .proc_handler = &proc_dointvec,
519 },
520#endif
490#ifdef CONFIG_MODULES 521#ifdef CONFIG_MODULES
491 { 522 {
492 .ctl_name = KERN_MODPROBE, 523 .ctl_name = KERN_MODPROBE,
@@ -918,12 +949,22 @@ static struct ctl_table vm_table[] = {
918 .data = &dirty_background_ratio, 949 .data = &dirty_background_ratio,
919 .maxlen = sizeof(dirty_background_ratio), 950 .maxlen = sizeof(dirty_background_ratio),
920 .mode = 0644, 951 .mode = 0644,
921 .proc_handler = &proc_dointvec_minmax, 952 .proc_handler = &dirty_background_ratio_handler,
922 .strategy = &sysctl_intvec, 953 .strategy = &sysctl_intvec,
923 .extra1 = &zero, 954 .extra1 = &zero,
924 .extra2 = &one_hundred, 955 .extra2 = &one_hundred,
925 }, 956 },
926 { 957 {
958 .ctl_name = CTL_UNNUMBERED,
959 .procname = "dirty_background_bytes",
960 .data = &dirty_background_bytes,
961 .maxlen = sizeof(dirty_background_bytes),
962 .mode = 0644,
963 .proc_handler = &dirty_background_bytes_handler,
964 .strategy = &sysctl_intvec,
965 .extra1 = &one,
966 },
967 {
927 .ctl_name = VM_DIRTY_RATIO, 968 .ctl_name = VM_DIRTY_RATIO,
928 .procname = "dirty_ratio", 969 .procname = "dirty_ratio",
929 .data = &vm_dirty_ratio, 970 .data = &vm_dirty_ratio,
@@ -935,6 +976,16 @@ static struct ctl_table vm_table[] = {
935 .extra2 = &one_hundred, 976 .extra2 = &one_hundred,
936 }, 977 },
937 { 978 {
979 .ctl_name = CTL_UNNUMBERED,
980 .procname = "dirty_bytes",
981 .data = &vm_dirty_bytes,
982 .maxlen = sizeof(vm_dirty_bytes),
983 .mode = 0644,
984 .proc_handler = &dirty_bytes_handler,
985 .strategy = &sysctl_intvec,
986 .extra1 = &one,
987 },
988 {
938 .procname = "dirty_writeback_centisecs", 989 .procname = "dirty_writeback_centisecs",
939 .data = &dirty_writeback_interval, 990 .data = &dirty_writeback_interval,
940 .maxlen = sizeof(dirty_writeback_interval), 991 .maxlen = sizeof(dirty_writeback_interval),
@@ -1651,7 +1702,7 @@ out:
1651 1702
1652static int test_perm(int mode, int op) 1703static int test_perm(int mode, int op)
1653{ 1704{
1654 if (!current->euid) 1705 if (!current_euid())
1655 mode >>= 6; 1706 mode >>= 6;
1656 else if (in_egroup_p(0)) 1707 else if (in_egroup_p(0))
1657 mode >>= 3; 1708 mode >>= 3;