402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

【OLK-6.6】arm版本hungtask_monitor触发系统自愈时不输出CPU调用栈

已完成
需求
创建于  
2023-12-19 20:13

【特性描述】
arm版本hungtask_monitor触发系统自愈时输出CPU调用栈

【特性竞争力】
hungtask_monitor在系统自愈后能正常在dmesg中打印调用栈

【硬件架构】
ARM

【特性约束】
NA

【涉及仓库】
OLK-5.10 OLK-6.6

【交付个人/团队】
@Jeffrey0Liao

【验证信息】
特性依赖:
CONFIG_DETECT_HUNG_TASK=y
CONFIG_WATCHDOG=y

启动项:
gic-version=3
irqchip.gicv3_pseudo_nmi=1
kgdboc=ttyAMA0,115200

用例:
打补丁前:
fsfreeze --freeze /
echo a > /a

363.535748] INFO: task sh:207 blocked for more than 120 seconds.
363.536419] Not tainted 6.6.0-01760-gf7998b87456a #5
363.5369931 "echo 0 > /proc/sys/kernel/hung task timeout secs" disables this message.
363.537529] task:sh state:D stack:0 pid:207 ppid:1 flags:0x00000000
363.538507] Call trace:
363.5392201 switch to+0xd0/0x1a4
363.5399661 schedule+0x2a0/0xa9c
363.540616] schedule+0x5c/0xc4
363.541157] percpu rwsem wait+0xe0/0xfc
363.541729] percpu down read+0x4c/0x98
363.542334] mnt want write+0x17c/0x1f0
363.543085] path openat+0xe88/0xe98
363.543734] do filp_open+0x84/0x108
363.5444151 do_sys_openat2+0x210/0x248
363.545144] do sys open+0x58/0xa4
363.545691] arm64 sys openat+0x24/0x30
363.5464361 invoke syscall.constprop.0+0x4c/0xd8
363.547487] do el0 svc+0x40/0xc8
363.547974] el0 svc+0x54/0x1b0
363.5485121 elOt 64 sync handler+0xc0/0xc4
363.549176] elOt 64 sync+0x1a4/0x1a8
363.550226] Kernel panic - not syncing: hung_task: blocked tasks
363.551678] CPU: 5 PID: 58 Comm: khungtaskd Not tainted 6.6.0-01760-gf7998b87456a #5
363.553341] Hardware name: Linux,dummy-virt (DT)
363.5542721 Call trace:
363.5546881 dump backtrace+0x94/0xec
363.5552311 show stack+0x18/0x24
363.555829] dump_stack lvl+0x74/0xcO
363.5563031 dump stack+0x18/0x24
363.556557] panic+0x378/0x3f0
363.556800] watchdog+0x2dc/0x514
363.5570731 kthread+0x11c/0x128
363.557325] ret from fork+0x10/0x20
363.558337] SMP: stopping secondary CPUse
363.559480] Kernel Offset: 0x285dace00000 from Oxffff800080000000
363.559988] PHYS OFFSET: 0xffff93f280000000
363.560377] CPU features: 0x1,10000003,3c020000,7000421b
363.561084] Memory Limit: none
363.561756] __-[ end Kernel panic - not syncing: hung task: blocked tasks

kernel panic,无调用栈打印

打补丁后:
echo 1 > /proc/sys/kernel/hung_task_all_cpu_backtrace
fsfreeze --freeze /
echo a > /a

[ 216.067707] INFO: task sh:206 blocked for more than 30 seconds.
216.0682407 Not tainted 6.6.0-01771-ga2b9a1cb048f #2
216.068617] "echo 0 > /proc/sys/kernel/hung task timeout secs" disables this message.
216.069108] task:sh state:D stack:0 pid:206 ppid:1 flags:0x00000000
216.069931] Call trace:
216.0702011 switch to+0xd0/0x1a4
216.0706511 schedule+0x29c/0xa64
216.0708851 schedule+0x5c/0xc4
216.071069] percpu_rwsem wait+0xe0/0xfc
216.0716911 percpu down read+0x4c/0x98
216.0719451 mnt want write+0x17c/0x1f0
216.072122] path openat+0xe88/0xe98
216.0723221 do filp open+0x84/0x108
216.072534] do_sys_openat2+0x210/0x248
216.072720] do sys open+0x58/0xa4
216.0729431 arm64 sys openat+0x24/0x30
216.0732021 invoke syscall.constprop.0+0x4c/0xd8
216.0735501 do el0 svc+0x40/0xc8
216.073790] el0 svc+0x4c/0x158
216.073997] elOt 64 sync handler+0xc0/0xc4
216.0742311 elOt 64 sync+0x190/0x194
216.0749561 NMI backtrace for cpu 6
216.075576] CPU: 6 PID: 58 Comm: khungtaskd Not tainted 6.6.0-01771-ga2b9a1cb048f #2
216.076248] Hardware name: Linux,dummy-virt (DT)
216.0765721 Call trace:
216.0768411 dump backtrace+0x94/0xec
216.077020] show stack+0x18/0x24
216.0771281 dump stack lvl+0x48/0x60
216.0773381 dump stack+0x18/0x24
216.0775311 nmi cpu backtrace+0x110/0x178
216.077764] nmi_trigger_cpumask backtrace+0x1f8/0x258
216.0779351 arch trigger cpumask backtrace+0x40/0x50
216.0781807 watchdog+0x4f0/0x50c
216.0783811 kthread+0x11c/0x128
216.0785651 ret from fork+0x10/0x20
216.079158] Sending NMI from CPU 6 to CPUs 0-5,7:
216.0800011 NMI backtrace for cpu 0 skipped: idling at default idle call+0x28/0x3c
216.080256] NMI backtrace for cpu 2 skipped: idling at default idle_call+0x28/0x3ce
216.0803431 NMI backtrace for cpu 7
216.080461] CPU: 7 PID:110 Comm: syslogd Not tainted 6.6.0-01771-ga2b9a1cb048f #2
216.080488] Hardware name: Linux,dummy-virt (DT)
216.080639] pstate: 20000000 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--
216.080759] pc : 0000ffffa700e410
216.0808721 lr : 0000aaaad083f79c
216.080982] sp : 0000ffffc16d6b20
216.081177] x29: 0000ffffc16d6b20 x28: 0000aaaad0906000 x27:0000000000000000

正常打印调用栈

评论 (1)

Jeffrey0Liao 创建了需求

Hi jeffrey-0liao, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers.

openeuler-ci-bot 添加了
 
sig/Kernel
标签
zhengzengkai 关联分支设置为OLK-6.6
Jeffrey0Liao 修改了描述
Jeffrey0Liao 修改了描述
ci-robot 通过openeuler/kernel Pull Request !3913任务状态新建 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助