diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 76 | 
1 files changed, 39 insertions, 37 deletions
| diff --git a/kernel/sysctl.c b/kernel/sysctl.c index d24f761f4876..ca38e8e3e907 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -44,16 +44,17 @@ | |||
| 44 | #include <linux/times.h> | 44 | #include <linux/times.h> | 
| 45 | #include <linux/limits.h> | 45 | #include <linux/limits.h> | 
| 46 | #include <linux/dcache.h> | 46 | #include <linux/dcache.h> | 
| 47 | #include <linux/dnotify.h> | ||
| 47 | #include <linux/syscalls.h> | 48 | #include <linux/syscalls.h> | 
| 48 | #include <linux/vmstat.h> | 49 | #include <linux/vmstat.h> | 
| 49 | #include <linux/nfs_fs.h> | 50 | #include <linux/nfs_fs.h> | 
| 50 | #include <linux/acpi.h> | 51 | #include <linux/acpi.h> | 
| 51 | #include <linux/reboot.h> | 52 | #include <linux/reboot.h> | 
| 52 | #include <linux/ftrace.h> | 53 | #include <linux/ftrace.h> | 
| 53 | #include <linux/slow-work.h> | ||
| 54 | #include <linux/perf_event.h> | 54 | #include <linux/perf_event.h> | 
| 55 | #include <linux/kprobes.h> | 55 | #include <linux/kprobes.h> | 
| 56 | #include <linux/pipe_fs_i.h> | 56 | #include <linux/pipe_fs_i.h> | 
| 57 | #include <linux/oom.h> | ||
| 57 | 58 | ||
| 58 | #include <asm/uaccess.h> | 59 | #include <asm/uaccess.h> | 
| 59 | #include <asm/processor.h> | 60 | #include <asm/processor.h> | 
| @@ -76,15 +77,16 @@ | |||
| 76 | #include <scsi/sg.h> | 77 | #include <scsi/sg.h> | 
| 77 | #endif | 78 | #endif | 
| 78 | 79 | ||
| 80 | #ifdef CONFIG_LOCKUP_DETECTOR | ||
| 81 | #include <linux/nmi.h> | ||
| 82 | #endif | ||
| 83 | |||
| 79 | 84 | ||
| 80 | #if defined(CONFIG_SYSCTL) | 85 | #if defined(CONFIG_SYSCTL) | 
| 81 | 86 | ||
| 82 | /* External variables not in a header file. */ | 87 | /* External variables not in a header file. */ | 
| 83 | extern int sysctl_overcommit_memory; | 88 | extern int sysctl_overcommit_memory; | 
| 84 | extern int sysctl_overcommit_ratio; | 89 | extern int sysctl_overcommit_ratio; | 
| 85 | extern int sysctl_panic_on_oom; | ||
| 86 | extern int sysctl_oom_kill_allocating_task; | ||
| 87 | extern int sysctl_oom_dump_tasks; | ||
| 88 | extern int max_threads; | 90 | extern int max_threads; | 
| 89 | extern int core_uses_pid; | 91 | extern int core_uses_pid; | 
| 90 | extern int suid_dumpable; | 92 | extern int suid_dumpable; | 
| @@ -106,7 +108,7 @@ extern int blk_iopoll_enabled; | |||
| 106 | #endif | 108 | #endif | 
| 107 | 109 | ||
| 108 | /* Constants used for minimum and maximum */ | 110 | /* Constants used for minimum and maximum */ | 
| 109 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 111 | #ifdef CONFIG_LOCKUP_DETECTOR | 
| 110 | static int sixty = 60; | 112 | static int sixty = 60; | 
| 111 | static int neg_one = -1; | 113 | static int neg_one = -1; | 
| 112 | #endif | 114 | #endif | 
| @@ -130,6 +132,9 @@ static int min_percpu_pagelist_fract = 8; | |||
| 130 | 132 | ||
| 131 | static int ngroups_max = NGROUPS_MAX; | 133 | static int ngroups_max = NGROUPS_MAX; | 
| 132 | 134 | ||
| 135 | #ifdef CONFIG_INOTIFY_USER | ||
| 136 | #include <linux/inotify.h> | ||
| 137 | #endif | ||
| 133 | #ifdef CONFIG_SPARC | 138 | #ifdef CONFIG_SPARC | 
| 134 | #include <asm/system.h> | 139 | #include <asm/system.h> | 
| 135 | #endif | 140 | #endif | 
| @@ -206,9 +211,6 @@ static struct ctl_table fs_table[]; | |||
| 206 | static struct ctl_table debug_table[]; | 211 | static struct ctl_table debug_table[]; | 
| 207 | static struct ctl_table dev_table[]; | 212 | static struct ctl_table dev_table[]; | 
| 208 | extern struct ctl_table random_table[]; | 213 | extern struct ctl_table random_table[]; | 
| 209 | #ifdef CONFIG_INOTIFY_USER | ||
| 210 | extern struct ctl_table inotify_table[]; | ||
| 211 | #endif | ||
| 212 | #ifdef CONFIG_EPOLL | 214 | #ifdef CONFIG_EPOLL | 
| 213 | extern struct ctl_table epoll_table[]; | 215 | extern struct ctl_table epoll_table[]; | 
| 214 | #endif | 216 | #endif | 
| @@ -562,7 +564,7 @@ static struct ctl_table kern_table[] = { | |||
| 562 | .extra2 = &one, | 564 | .extra2 = &one, | 
| 563 | }, | 565 | }, | 
| 564 | #endif | 566 | #endif | 
| 565 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 567 | #ifdef CONFIG_HOTPLUG | 
| 566 | { | 568 | { | 
| 567 | .procname = "hotplug", | 569 | .procname = "hotplug", | 
| 568 | .data = &uevent_helper, | 570 | .data = &uevent_helper, | 
| @@ -710,7 +712,34 @@ static struct ctl_table kern_table[] = { | |||
| 710 | .mode = 0444, | 712 | .mode = 0444, | 
| 711 | .proc_handler = proc_dointvec, | 713 | .proc_handler = proc_dointvec, | 
| 712 | }, | 714 | }, | 
| 713 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | 715 | #if defined(CONFIG_LOCKUP_DETECTOR) | 
| 716 | { | ||
| 717 | .procname = "watchdog", | ||
| 718 | .data = &watchdog_enabled, | ||
| 719 | .maxlen = sizeof (int), | ||
| 720 | .mode = 0644, | ||
| 721 | .proc_handler = proc_dowatchdog_enabled, | ||
| 722 | }, | ||
| 723 | { | ||
| 724 | .procname = "watchdog_thresh", | ||
| 725 | .data = &softlockup_thresh, | ||
| 726 | .maxlen = sizeof(int), | ||
| 727 | .mode = 0644, | ||
| 728 | .proc_handler = proc_dowatchdog_thresh, | ||
| 729 | .extra1 = &neg_one, | ||
| 730 | .extra2 = &sixty, | ||
| 731 | }, | ||
| 732 | { | ||
| 733 | .procname = "softlockup_panic", | ||
| 734 | .data = &softlockup_panic, | ||
| 735 | .maxlen = sizeof(int), | ||
| 736 | .mode = 0644, | ||
| 737 | .proc_handler = proc_dointvec_minmax, | ||
| 738 | .extra1 = &zero, | ||
| 739 | .extra2 = &one, | ||
| 740 | }, | ||
| 741 | #endif | ||
| 742 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) | ||
| 714 | { | 743 | { | 
| 715 | .procname = "unknown_nmi_panic", | 744 | .procname = "unknown_nmi_panic", | 
| 716 | .data = &unknown_nmi_panic, | 745 | .data = &unknown_nmi_panic, | 
| @@ -813,26 +842,6 @@ static struct ctl_table kern_table[] = { | |||
| 813 | .proc_handler = proc_dointvec, | 842 | .proc_handler = proc_dointvec, | 
| 814 | }, | 843 | }, | 
| 815 | #endif | 844 | #endif | 
| 816 | #ifdef CONFIG_DETECT_SOFTLOCKUP | ||
| 817 | { | ||
| 818 | .procname = "softlockup_panic", | ||
| 819 | .data = &softlockup_panic, | ||
| 820 | .maxlen = sizeof(int), | ||
| 821 | .mode = 0644, | ||
| 822 | .proc_handler = proc_dointvec_minmax, | ||
| 823 | .extra1 = &zero, | ||
| 824 | .extra2 = &one, | ||
| 825 | }, | ||
| 826 | { | ||
| 827 | .procname = "softlockup_thresh", | ||
| 828 | .data = &softlockup_thresh, | ||
| 829 | .maxlen = sizeof(int), | ||
| 830 | .mode = 0644, | ||
| 831 | .proc_handler = proc_dosoftlockup_thresh, | ||
| 832 | .extra1 = &neg_one, | ||
| 833 | .extra2 = &sixty, | ||
| 834 | }, | ||
| 835 | #endif | ||
| 836 | #ifdef CONFIG_DETECT_HUNG_TASK | 845 | #ifdef CONFIG_DETECT_HUNG_TASK | 
| 837 | { | 846 | { | 
| 838 | .procname = "hung_task_panic", | 847 | .procname = "hung_task_panic", | 
| @@ -906,13 +915,6 @@ static struct ctl_table kern_table[] = { | |||
| 906 | .proc_handler = proc_dointvec, | 915 | .proc_handler = proc_dointvec, | 
| 907 | }, | 916 | }, | 
| 908 | #endif | 917 | #endif | 
| 909 | #ifdef CONFIG_SLOW_WORK | ||
| 910 | { | ||
| 911 | .procname = "slow-work", | ||
| 912 | .mode = 0555, | ||
| 913 | .child = slow_work_sysctls, | ||
| 914 | }, | ||
| 915 | #endif | ||
| 916 | #ifdef CONFIG_PERF_EVENTS | 918 | #ifdef CONFIG_PERF_EVENTS | 
| 917 | { | 919 | { | 
| 918 | .procname = "perf_event_paranoid", | 920 | .procname = "perf_event_paranoid", | 
