Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198278
b: refs/heads/master
c: 940370f
h: refs/heads/master
v: v3
  • Loading branch information
Yury Polyanskiy authored and Linus Torvalds committed May 25, 2010
1 parent 77fedf7 commit 3fdce32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3b77c8caef1750ebeea1054e39e358550ea9f55
refs/heads/master: 940370fc86b920b51a34217a1facc3e9e97c2456
20 changes: 14 additions & 6 deletions trunk/drivers/char/hangcheck-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
#include <asm/uaccess.h>
#include <linux/sysrq.h>
#include <linux/timer.h>
#include <linux/time.h>

#define VERSION_STR "0.9.0"
#define VERSION_STR "0.9.1"

#define DEFAULT_IOFENCE_MARGIN 60 /* Default fudge factor, in seconds */
#define DEFAULT_IOFENCE_TICK 180 /* Default timer timeout, in seconds */
Expand Down Expand Up @@ -119,18 +120,18 @@ __setup("hcheck_dump_tasks", hangcheck_parse_dump_tasks);
#if defined(CONFIG_S390)
# define HAVE_MONOTONIC
# define TIMER_FREQ 1000000000ULL
#elif defined(CONFIG_IA64)
# define TIMER_FREQ ((unsigned long long)local_cpu_data->itc_freq)
#else
# define TIMER_FREQ (HZ*loops_per_jiffy)
# define TIMER_FREQ 1000000000ULL
#endif

#ifdef HAVE_MONOTONIC
extern unsigned long long monotonic_clock(void);
#else
static inline unsigned long long monotonic_clock(void)
{
return get_cycles();
struct timespec ts;
getrawmonotonic(&ts);
return timespec_to_ns(&ts);
}
#endif /* HAVE_MONOTONIC */

Expand Down Expand Up @@ -168,6 +169,13 @@ static void hangcheck_fire(unsigned long data)
printk(KERN_CRIT "Hangcheck: hangcheck value past margin!\n");
}
}
#if 0
/*
* Enable to investigate delays in detail
*/
printk("Hangcheck: called %Ld ns since last time (%Ld ns overshoot)\n",
tsc_diff, tsc_diff - hangcheck_tick*TIMER_FREQ);
#endif
mod_timer(&hangcheck_ticktock, jiffies + (hangcheck_tick*HZ));
hangcheck_tsc = monotonic_clock();
}
Expand All @@ -180,7 +188,7 @@ static int __init hangcheck_init(void)
#if defined (HAVE_MONOTONIC)
printk("Hangcheck: Using monotonic_clock().\n");
#else
printk("Hangcheck: Using get_cycles().\n");
printk("Hangcheck: Using getrawmonotonic().\n");
#endif /* HAVE_MONOTONIC */
hangcheck_tsc_margin =
(unsigned long long)(hangcheck_margin + hangcheck_tick);
Expand Down

0 comments on commit 3fdce32

Please sign in to comment.