// SPDX-License-Identifier: GPL-2.0-only /* * hangcheck-timer.c * * Driver for a little io fencing timer. * * Copyright (C) 2002, 2003 Oracle. All rights reserved. * * Author: Joel Becker <joel.becker@oracle.com>
*/
/* * The hangcheck-timer driver uses the TSC to catch delays that * jiffies does not notice. A timer is set. When the timer fires, it * checks whether it was delayed and if that delay exceeds a given * margin of error. The hangcheck_tick module parameter takes the timer * duration in seconds. The hangcheck_margin parameter defines the * margin of error, in seconds. The defaults are 60 seconds for the * timer and 180 seconds for the margin of error. IOW, a timer is set * for 60 seconds. When the timer fires, the callback checks the * actual duration that the timer waited. If the duration exceeds the * allotted time and margin (here 60 + 180, or 240 seconds), the machine * is restarted. A healthy machine will have the duration match the * expected timeout very closely.
*/
#define DEFAULT_IOFENCE_MARGIN 60 /* Default fudge factor, in seconds */ #define DEFAULT_IOFENCE_TICK 180 /* Default timer timeout, in seconds */
staticint hangcheck_tick = DEFAULT_IOFENCE_TICK; staticint hangcheck_margin = DEFAULT_IOFENCE_MARGIN; staticint hangcheck_reboot; /* Defaults to not reboot */ staticint hangcheck_dump_tasks; /* Defaults to not dumping SysRQ T */
/* options - modular */
module_param(hangcheck_tick, int, 0);
MODULE_PARM_DESC(hangcheck_tick, "Timer delay.");
module_param(hangcheck_margin, int, 0);
MODULE_PARM_DESC(hangcheck_margin, "If the hangcheck timer has been delayed more than hangcheck_margin seconds, the driver will fire.");
module_param(hangcheck_reboot, int, 0);
MODULE_PARM_DESC(hangcheck_reboot, "If nonzero, the machine will reboot when the timer margin is exceeded.");
module_param(hangcheck_dump_tasks, int, 0);
MODULE_PARM_DESC(hangcheck_dump_tasks, "If nonzero, the machine will dump the system task state when the timer margin is exceeded.");
MODULE_AUTHOR("Oracle");
MODULE_DESCRIPTION("Hangcheck-timer detects when the system has gone out to lunch past a certain margin.");
MODULE_LICENSE("GPL");
MODULE_VERSION(VERSION_STR);
/* options - nonmodular */ #ifndef MODULE
staticint __init hangcheck_parse_tick(char *str)
{ int par; if (get_option(&str,&par))
hangcheck_tick = par; return 1;
}
staticint __init hangcheck_parse_margin(char *str)
{ int par; if (get_option(&str,&par))
hangcheck_margin = par; return 1;
}
staticint __init hangcheck_parse_reboot(char *str)
{ int par; if (get_option(&str,&par))
hangcheck_reboot = par; return 1;
}
staticint __init hangcheck_parse_dump_tasks(char *str)
{ int par; if (get_option(&str,&par))
hangcheck_dump_tasks = par; return 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.