本文主要是介绍Linux fdisk -l引起内核死锁分析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Linux fdisk -l查看分区,结果打印一个分区后引起内核死锁。
打印
root@www:~# fdisk -lDisk /dev/mtdblock0: 2 MB, 2621440 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/mtdblock0 doesn't contain a valid partition tableINFO: task update_mcu.sh:254 blocked for more than 120 seconds.Not tainted 3.18.20 #2
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
update_mcu.sh D c0887e9c 0 254 1 0x00000000
Backtrace:
[<c0887b60>] (__schedule) from [<c08880f4>] (schedule+0xa0/0xa4)r10:019b00ec r9:00000002 r8:ffffffff r7:cb0c2200 r6:ce94d448 r5:cd81a018r4:cd81a000
[<c0888054>] (schedule) from [<c08883e4>] (schedule_preempt_disabled+0x30/0x40)
[<c08883b4>] (schedule_preempt_disabled) from [<c0889c3c>] (__mutex_lock_slowpath+0xc0/0x188)r4:ce94d444 r3:00000001
[<c0889b7c>] (__mutex_lock_slowpath) from [<c0889d3c>] (mutex_lock+0x38/0x3c)r9:ce94d444 r8:cf844590 r7:cf844500 r6:cd81b938 r5:cf8449f4 r4:ce94d010
[<c0889d04>] (mutex_lock) from [<c03c8f74>] (msm_nand_read_oob+0x3f0/0x8fc)
[<c03c8b84>] (msm_nand_read_oob) from [<c03c95c8>] (msm_nand_read_partial_page+0x148/0x22c)
分析
可以看到是内核死锁超时2分钟打印出backtrace,死锁函数msm_nand_read_oob中的mutex_lock锁等待超时死锁,通过Linux下使用额外增加文件方式查看debug信息添加开关代码如下:
static int msm_nand_read_oob(struct mtd_info *mtd, loff_t from,struct mtd_oob_ops *ops)
{if(1 == io_run_num) {printk(KERN_ERR "eason in\n");}mutex_lock(&info->lock);if(1 == io_run_num) {printk(KERN_ERR "eason out\n");}
fdisk -l死锁后打印如下:
eason in
eason out
QCMAP:bringup v6
enter sleep, msm_uport->obs: 0
msm_hs_pm_resume(): jun test1
resule from sleep, msm_uport->obs: 0
eason in
enter sleep, msm_uport->obs: 0
没有out出
移远回复说不支持查看nand flash,如果有其他设备可以使用fdisk /dev/*进行查看,原因未告知,且暂不解决;我个人认为这不合理的,其他设备上面fdisk就可以查看flash,且导致了内核死锁应该就是可以查看原因和解决的。
原因待继续查。。。
这篇关于Linux fdisk -l引起内核死锁分析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!