aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorChuansheng Liu <chuansheng.liu@intel.com>2012-11-26 19:29:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-26 20:41:24 -0500
commit8ffeb9b0e6369135bf03a073514f571ef10606b9 (patch)
tree53376636381d6a01afae72ed8541266f60a7afae /kernel/watchdog.c
parent4eff96dd5283a102e0c1cac95247090be74a38ed (diff)
watchdog: using u64 in get_sample_period()
In get_sample_period(), unsigned long is not enough: watchdog_thresh * 2 * (NSEC_PER_SEC / 5) case1: watchdog_thresh is 10 by default, the sample value will be: 0xEE6B2800 case2: set watchdog_thresh is 20, the sample value will be: 0x1 DCD6 5000 In case2, we need use u64 to express the sample period. Otherwise, changing the threshold thru proc often can not be successful. Signed-off-by: liu chuansheng <chuansheng.liu@intel.com> Acked-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 9d4c8d5a1f53..dd4b80a9f1a9 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -116,7 +116,7 @@ static unsigned long get_timestamp(int this_cpu)
116 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ 116 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */
117} 117}
118 118
119static unsigned long get_sample_period(void) 119static u64 get_sample_period(void)
120{ 120{
121 /* 121 /*
122 * convert watchdog_thresh from seconds to ns 122 * convert watchdog_thresh from seconds to ns
@@ -125,7 +125,7 @@ static unsigned long get_sample_period(void)
125 * and hard thresholds) to increment before the 125 * and hard thresholds) to increment before the
126 * hardlockup detector generates a warning 126 * hardlockup detector generates a warning
127 */ 127 */
128 return get_softlockup_thresh() * (NSEC_PER_SEC / 5); 128 return get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5);
129} 129}
130 130
131/* Commands for resetting the watchdog */ 131/* Commands for resetting the watchdog */