Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53920
b: refs/heads/master
c: 8a336b0
h: refs/heads/master
v: v3
  • Loading branch information
Tim Hockin authored and Andi Kleen committed May 2, 2007
1 parent b6b981b commit 5a27066
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 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: f82af20e1a028e16b9bb11da081fa1148d40fa6a
refs/heads/master: 8a336b0a4b6dfacc8cc5fd617ba1e1904077de2d
7 changes: 6 additions & 1 deletion trunk/Documentation/x86_64/machinecheck
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ between all CPUs.

check_interval
How often to poll for corrected machine check errors, in seconds
(Note output is hexademical). Default 5 minutes.
(Note output is hexademical). Default 5 minutes. When the poller
finds MCEs it triggers an exponential speedup (poll more often) on
the polling interval. When the poller stops finding MCEs, it
triggers an exponential backoff (poll less often) on the polling
interval. The check_interval variable is both the initial and
maximum polling interval.

tolerant
Tolerance level. When a machine check exception occurs for a non
Expand Down
32 changes: 24 additions & 8 deletions trunk/arch/x86_64/kernel/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,13 @@ void mce_log_therm_throt_event(unsigned int cpu, __u64 status)
#endif /* CONFIG_X86_MCE_INTEL */

/*
* Periodic polling timer for "silent" machine check errors.
* Periodic polling timer for "silent" machine check errors. If the
* poller finds an MCE, poll 2x faster. When the poller finds no more
* errors, poll 2x slower (up to check_interval seconds).
*/

static int check_interval = 5 * 60; /* 5 minutes */
static int next_interval; /* in jiffies */
static void mcheck_timer(struct work_struct *work);
static DECLARE_DELAYED_WORK(mcheck_work, mcheck_timer);

Expand All @@ -339,7 +342,6 @@ static void mcheck_check_cpu(void *info)
static void mcheck_timer(struct work_struct *work)
{
on_each_cpu(mcheck_check_cpu, NULL, 1, 1);
schedule_delayed_work(&mcheck_work, check_interval * HZ);

/*
* It's ok to read stale data here for notify_user and
Expand All @@ -349,17 +351,30 @@ static void mcheck_timer(struct work_struct *work)
* writes.
*/
if (notify_user && console_logged) {
static unsigned long last_print;
unsigned long now = jiffies;

/* if we logged an MCE, reduce the polling interval */
next_interval = max(next_interval/2, HZ/100);
notify_user = 0;
clear_bit(0, &console_logged);
printk(KERN_INFO "Machine check events logged\n");
if (time_after_eq(now, last_print + (check_interval*HZ))) {
last_print = now;
printk(KERN_INFO "Machine check events logged\n");
}
} else {
next_interval = min(next_interval*2, check_interval*HZ);
}

schedule_delayed_work(&mcheck_work, next_interval);
}


static __init int periodic_mcheck_init(void)
{
if (check_interval)
schedule_delayed_work(&mcheck_work, check_interval*HZ);
next_interval = check_interval * HZ;
if (next_interval)
schedule_delayed_work(&mcheck_work, next_interval);
return 0;
}
__initcall(periodic_mcheck_init);
Expand Down Expand Up @@ -597,12 +612,13 @@ static int mce_resume(struct sys_device *dev)
/* Reinit MCEs after user configuration changes */
static void mce_restart(void)
{
if (check_interval)
if (next_interval)
cancel_delayed_work(&mcheck_work);
/* Timer race is harmless here */
on_each_cpu(mce_init, NULL, 1, 1);
if (check_interval)
schedule_delayed_work(&mcheck_work, check_interval*HZ);
next_interval = check_interval * HZ;
if (next_interval)
schedule_delayed_work(&mcheck_work, next_interval);
}

static struct sysdev_class mce_sysclass = {
Expand Down

0 comments on commit 5a27066

Please sign in to comment.