Commit 90739081ef8d5495d50abba9c5d333be9acd872a
1 parent
9745512ce7
Exists in
master
and in
4 other branches
softlockup: fix signedness
fix softlockup tunables signedness. mark tunables read-mostly. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 3 changed files with 15 additions and 15 deletions Side-by-side Diff
include/linux/sched.h
... | ... | @@ -269,10 +269,10 @@ |
269 | 269 | extern void spawn_softlockup_task(void); |
270 | 270 | extern void touch_softlockup_watchdog(void); |
271 | 271 | extern void touch_all_softlockup_watchdogs(void); |
272 | -extern int softlockup_thresh; | |
272 | +extern unsigned long softlockup_thresh; | |
273 | 273 | extern unsigned long sysctl_hung_task_check_count; |
274 | 274 | extern unsigned long sysctl_hung_task_timeout_secs; |
275 | -extern long sysctl_hung_task_warnings; | |
275 | +extern unsigned long sysctl_hung_task_warnings; | |
276 | 276 | #else |
277 | 277 | static inline void softlockup_tick(void) |
278 | 278 | { |
kernel/softlockup.c
... | ... | @@ -24,8 +24,8 @@ |
24 | 24 | static DEFINE_PER_CPU(unsigned long, print_timestamp); |
25 | 25 | static DEFINE_PER_CPU(struct task_struct *, watchdog_task); |
26 | 26 | |
27 | -static int did_panic; | |
28 | -int softlockup_thresh = 60; | |
27 | +static int __read_mostly did_panic; | |
28 | +unsigned long __read_mostly softlockup_thresh = 60; | |
29 | 29 | |
30 | 30 | static int |
31 | 31 | softlock_panic(struct notifier_block *this, unsigned long event, void *ptr) |
32 | 32 | |
33 | 33 | |
... | ... | @@ -121,14 +121,14 @@ |
121 | 121 | /* |
122 | 122 | * Have a reasonable limit on the number of tasks checked: |
123 | 123 | */ |
124 | -unsigned long sysctl_hung_task_check_count = 1024; | |
124 | +unsigned long __read_mostly sysctl_hung_task_check_count = 1024; | |
125 | 125 | |
126 | 126 | /* |
127 | 127 | * Zero means infinite timeout - no checking done: |
128 | 128 | */ |
129 | -unsigned long sysctl_hung_task_timeout_secs = 120; | |
129 | +unsigned long __read_mostly sysctl_hung_task_timeout_secs = 120; | |
130 | 130 | |
131 | -long sysctl_hung_task_warnings = 10; | |
131 | +unsigned long __read_mostly sysctl_hung_task_warnings = 10; | |
132 | 132 | |
133 | 133 | /* |
134 | 134 | * Only do the hung-tasks check on one CPU: |
kernel/sysctl.c
... | ... | @@ -772,9 +772,9 @@ |
772 | 772 | .ctl_name = CTL_UNNUMBERED, |
773 | 773 | .procname = "softlockup_thresh", |
774 | 774 | .data = &softlockup_thresh, |
775 | - .maxlen = sizeof(int), | |
775 | + .maxlen = sizeof(unsigned long), | |
776 | 776 | .mode = 0644, |
777 | - .proc_handler = &proc_dointvec_minmax, | |
777 | + .proc_handler = &proc_doulongvec_minmax, | |
778 | 778 | .strategy = &sysctl_intvec, |
779 | 779 | .extra1 = &one, |
780 | 780 | .extra2 = &sixty, |
781 | 781 | |
782 | 782 | |
783 | 783 | |
784 | 784 | |
785 | 785 | |
... | ... | @@ -783,27 +783,27 @@ |
783 | 783 | .ctl_name = CTL_UNNUMBERED, |
784 | 784 | .procname = "hung_task_check_count", |
785 | 785 | .data = &sysctl_hung_task_check_count, |
786 | - .maxlen = sizeof(int), | |
786 | + .maxlen = sizeof(unsigned long), | |
787 | 787 | .mode = 0644, |
788 | - .proc_handler = &proc_dointvec_minmax, | |
788 | + .proc_handler = &proc_doulongvec_minmax, | |
789 | 789 | .strategy = &sysctl_intvec, |
790 | 790 | }, |
791 | 791 | { |
792 | 792 | .ctl_name = CTL_UNNUMBERED, |
793 | 793 | .procname = "hung_task_timeout_secs", |
794 | 794 | .data = &sysctl_hung_task_timeout_secs, |
795 | - .maxlen = sizeof(int), | |
795 | + .maxlen = sizeof(unsigned long), | |
796 | 796 | .mode = 0644, |
797 | - .proc_handler = &proc_dointvec_minmax, | |
797 | + .proc_handler = &proc_doulongvec_minmax, | |
798 | 798 | .strategy = &sysctl_intvec, |
799 | 799 | }, |
800 | 800 | { |
801 | 801 | .ctl_name = CTL_UNNUMBERED, |
802 | 802 | .procname = "hung_task_warnings", |
803 | 803 | .data = &sysctl_hung_task_warnings, |
804 | - .maxlen = sizeof(int), | |
804 | + .maxlen = sizeof(unsigned long), | |
805 | 805 | .mode = 0644, |
806 | - .proc_handler = &proc_dointvec_minmax, | |
806 | + .proc_handler = &proc_doulongvec_minmax, | |
807 | 807 | .strategy = &sysctl_intvec, |
808 | 808 | }, |
809 | 809 | #endif |