You need to sign in or sign up before continuing.
提交 dd8409a9 编写于 作者: X Xu Qiang 提交者: Zheng Zengkai

watchdog/corelockup: Add interface to control the detection sensitivity.

ascend inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4F3V1
CVE: NA

--------------------------------

A user-mode interface is added to control the core lockup
detection sensitivity.
Signed-off-by: NXu Qiang <xuqiang36@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ec6b79f6
......@@ -132,6 +132,7 @@ extern void corelockup_detector_offline_cpu(unsigned int cpu);
extern void watchdog_check_hrtimer(void);
extern unsigned long watchdog_hrtimer_interrupts(unsigned int cpu);
extern bool enable_corelockup_detector;
extern int corelockup_miss_thresh;
#endif
void watchdog_nmi_stop(void);
......
......@@ -113,7 +113,9 @@ static int sixty = 60;
static int __maybe_unused neg_one = -1;
static int __maybe_unused two = 2;
static int __maybe_unused three = 3;
static int __maybe_unused four = 4;
static int __maybe_unused five = 5;
static unsigned long zero_ul;
static unsigned long one_ul = 1;
static unsigned long long_max = LONG_MAX;
......@@ -2405,6 +2407,17 @@ static struct ctl_table kern_table[] = {
},
#endif /* CONFIG_SMP */
#endif
#ifdef CONFIG_CORELOCKUP_DETECTOR
{
.procname = "corelockup_thresh",
.data = &corelockup_miss_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &three,
.extra2 = &five,
},
#endif
#endif
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
......
......@@ -83,6 +83,7 @@ static DEFINE_PER_CPU(unsigned long, hrint_saved);
static DEFINE_PER_CPU(unsigned long, hrint_missed);
static unsigned long corelockup_allcpu_dumped;
bool enable_corelockup_detector;
int __read_mostly corelockup_miss_thresh = 5;
static int __init enable_corelockup_detector_setup(char *str)
{
......@@ -169,7 +170,8 @@ void watchdog_check_hrtimer(void)
}
__this_cpu_inc(nmi_cnt_missed);
if ((__this_cpu_read(hrint_missed) > 5) && (__this_cpu_read(nmi_cnt_missed) > 5)) {
if ((__this_cpu_read(hrint_missed) > corelockup_miss_thresh)
&& (__this_cpu_read(nmi_cnt_missed) > corelockup_miss_thresh)) {
pr_emerg("Watchdog detected core LOCKUP on cpu %d\n", cpu);
if (!test_and_set_bit(0, &corelockup_allcpu_dumped)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册