Linux系统报错NMI watchdog: BUG: soft lockup - CPU#5 stuck for 24s

目录

  • 一、问题描述
  • 二、解决方法
    • 1.将 watchlog_thresh 临时设置为 30
    • 2.将 watchlog_thresh 永久设置为 30
    • 3.将 watchlog_thresh 写入启动文件


一、问题描述

Linux 系统响应变慢,显示错误信息如下:

May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#5 stuck for 24s! [watchdog/5:34]
May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#12 stuck for 26s! [java:22117]
May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#4 stuck for 24s! [swapper/4:0]
May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [watchdog/1:13]
May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#7 stuck for 21s! [java:31821]
May  9 14:43:05 localhost kernel: NMI watchdog: BUG: soft lockup - CPU#2 stuck for 44s! [swapper/2:0]

二、解决方法

kernel watchdog 是用来检测 lockup 的,所谓 lockup,是指某段内核代码占着 CPU 不放,lookup 严重的时候会导致整个系统失去响应。
soft lockup 是指 CPU 被内核代码占据,以至于无法执行其它进程。
解决方法如下:

1.将 watchlog_thresh 临时设置为 30

sysctl -w kernel.watchdog_thresh=30

2.将 watchlog_thresh 永久设置为 30

echo 30 > /proc/sys/kernel/watchdog_thresh

3.将 watchlog_thresh 写入启动文件

kernel.watchdog_thresh=30 >> /etc/sysctl.conf

你可能感兴趣的:(常见问题解答(FAQ),linux,soft,lockup)