[ 3.5.y.z extended stable ] Patch "watchdog: using u64 in get_sample_period()" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Thu Dec 13 04:45:59 UTC 2012

This is a note to let you know that I have just added a patch titled

    watchdog: using u64 in get_sample_period()

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



>From 3acbf3f900ffa4eb71cae7fcb68cc915f8347391 Mon Sep 17 00:00:00 2001
From: Chuansheng Liu <chuansheng.liu at intel.com>
Date: Mon, 26 Nov 2012 16:29:54 -0800
Subject: [PATCH 06/20] watchdog: using u64 in get_sample_period()

commit 8ffeb9b0e6369135bf03a073514f571ef10606b9 usptream.

In get_sample_period(), unsigned long is not enough:

  watchdog_thresh * 2 * (NSEC_PER_SEC / 5)

  watchdog_thresh is 10 by default, the sample value will be: 0xEE6B2800

 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 at intel.com>
Acked-by: Don Zickus <dzickus at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
 kernel/watchdog.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 4b1dfba..775fa0f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -113,7 +113,7 @@ static unsigned long get_timestamp(int this_cpu)
 	return cpu_clock(this_cpu) >> 30LL;  /* 2^30 ~= 10^9 */

-static unsigned long get_sample_period(void)
+static u64 get_sample_period(void)
 	 * convert watchdog_thresh from seconds to ns
@@ -122,7 +122,7 @@ static unsigned long get_sample_period(void)
 	 * and hard thresholds) to increment before the
 	 * hardlockup detector generates a warning
-	return get_softlockup_thresh() * (NSEC_PER_SEC / 5);
+	return get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5);

 /* Commands for resetting the watchdog */

More information about the kernel-team mailing list