Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105187
b: refs/heads/master
c: 9383d96
h: refs/heads/master
i:
  105185: fc5739a
  105183: 082e2e8
v: v3
  • Loading branch information
Dimitri Sivanich authored and Thomas Gleixner committed May 25, 2008
1 parent 48c322c commit 8512db1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 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: 9c44bc03fff44ff04237a7d92e35304a0e50c331
refs/heads/master: 9383d9679056e6cc4e7ff70f31da945a268238f4
2 changes: 1 addition & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ extern void spawn_softlockup_task(void);
extern void touch_softlockup_watchdog(void);
extern void touch_all_softlockup_watchdogs(void);
extern unsigned int softlockup_panic;
extern unsigned long softlockup_thresh;
extern unsigned long sysctl_hung_task_check_count;
extern unsigned long sysctl_hung_task_timeout_secs;
extern unsigned long sysctl_hung_task_warnings;
extern int softlockup_thresh;
#else
static inline void softlockup_tick(void)
{
Expand Down
12 changes: 10 additions & 2 deletions trunk/kernel/softlockup.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static DEFINE_PER_CPU(unsigned long, print_timestamp);
static DEFINE_PER_CPU(struct task_struct *, watchdog_task);

static int __read_mostly did_panic;
unsigned long __read_mostly softlockup_thresh = 60;
int __read_mostly softlockup_thresh = 60;

/*
* Should we panic (and reboot, if panic_timeout= is set) when a
Expand Down Expand Up @@ -94,6 +94,14 @@ void softlockup_tick(void)
struct pt_regs *regs = get_irq_regs();
unsigned long now;

/* Is detection switched off? */
if (!per_cpu(watchdog_task, this_cpu) || softlockup_thresh <= 0) {
/* Be sure we don't false trigger if switched back on */
if (touch_timestamp)
per_cpu(touch_timestamp, this_cpu) = 0;
return;
}

if (touch_timestamp == 0) {
touch_softlockup_watchdog();
return;
Expand All @@ -104,7 +112,7 @@ void softlockup_tick(void)
/* report at most once a second */
if ((print_timestamp >= touch_timestamp &&
print_timestamp < (touch_timestamp + 1)) ||
did_panic || !per_cpu(watchdog_task, this_cpu)) {
did_panic) {
return;
}

Expand Down
9 changes: 5 additions & 4 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ extern int latencytop_enabled;
extern int sysctl_nr_open_min, sysctl_nr_open_max;

/* Constants used for minimum and maximum */
#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
#ifdef CONFIG_HIGHMEM
static int one = 1;
#endif

#ifdef CONFIG_DETECT_SOFTLOCKUP
static int sixty = 60;
static int neg_one = -1;
#endif

#ifdef CONFIG_MMU
Expand Down Expand Up @@ -742,11 +743,11 @@ static struct ctl_table kern_table[] = {
.ctl_name = CTL_UNNUMBERED,
.procname = "softlockup_thresh",
.data = &softlockup_thresh,
.maxlen = sizeof(unsigned long),
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &one,
.extra1 = &neg_one,
.extra2 = &sixty,
},
{
Expand Down

0 comments on commit 8512db1

Please sign in to comment.