Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux kernel 自旋锁锁定怀疑原因_Linux Kernel_Synchronization_Spinlock - Fatal编程技术网

Linux kernel 自旋锁锁定怀疑原因

Linux kernel 自旋锁锁定怀疑原因,linux-kernel,synchronization,spinlock,Linux Kernel,Synchronization,Spinlock,出现以下消息的原因可能是什么: 错误:怀疑CPU#0、sh/11786上存在自旋锁锁定 锁:kmap\u锁+0x0/0x40,.magic:dead4ead,.owner:sh/11787,.owner\u cpu:1 大宗报价 错误:怀疑CPU#0、sh/11786上存在自旋锁锁定 这表明CPU0被锁定,线程/进程将是sh(或者由sh启动,我不确定)。您应该看看内核转储的堆栈策略信息。例如: 127|uid=0 gid=1007@nutshell:/var # [ 172.285647] B

出现以下消息的原因可能是什么:

错误:怀疑CPU#0、sh/11786上存在自旋锁锁定

锁:kmap\u锁+0x0/0x40,.magic:dead4ead,.owner:sh/11787,.owner\u cpu:1

大宗报价 错误:怀疑CPU#0、sh/11786上存在自旋锁锁定

这表明CPU0被锁定,线程/进程将是sh(或者由sh启动,我不确定)。您应该看看内核转储的堆栈策略信息。例如:

127|uid=0 gid=1007@nutshell:/var # [  172.285647] BUG: spinlock lockup on CPU#0, swapper/0, 983482f0
[  172.291523] [<8003cb44>] (unwind_backtrace+0x0/0xf8) from [<801853e4>] (do_raw_spin_lock+0x100/0x164)
[  172.300768] [<801853e4>] (do_raw_spin_lock+0x100/0x164) from [<80350508>] (_raw_spin_lock_irqsave+0x54/0x60)
[  172.310618] [<80350508>] (_raw_spin_lock_irqsave+0x54/0x60) from [<7f3cf4a0>] (mlb_os81092_interrupt+0x18/0x68 [os81092])
[  172.321636] [<7f3cf4a0>] (mlb_os81092_interrupt+0x18/0x68 [os81092]) from [<800abee0>] (handle_irq_event_percpu+0x50/0x184)
[  172.332781] [<800abee0>] (handle_irq_event_percpu+0x50/0x184) from [<800ac050>] (handle_irq_event+0x3c/0x5c)
[  172.342622] [<800ac050>] (handle_irq_event+0x3c/0x5c) from [<800ae00c>] (handle_level_irq+0xac/0xfc)
[  172.351767] [<800ae00c>] (handle_level_irq+0xac/0xfc) from [<800ab82c>] (generic_handle_irq+0x2c/0x40)
[  172.361090] [<800ab82c>] (generic_handle_irq+0x2c/0x40) from [<800552e8>] (mx3_gpio_irq_handler+0x78/0x140)
[  172.370843] [<800552e8>] (mx3_gpio_irq_handler+0x78/0x140) from [<800ab82c>] (generic_handle_irq+0x2c/0x40)
[  172.380595] [<800ab82c>] (generic_handle_irq+0x2c/0x40) from [<80036904>] (handle_IRQ+0x4c/0xac)
[  172.389402] [<80036904>] (handle_IRQ+0x4c/0xac) from [<80035ad0>] (__irq_svc+0x50/0xd0)
[  172.397416] [<80035ad0>] (__irq_svc+0x50/0xd0) from [<80036bb4>] (default_idle+0x28/0x2c)
[  172.405603] [<80036bb4>] (default_idle+0x28/0x2c) from [<80036e9c>] (cpu_idle+0x9c/0x108)
[  172.413793] [<80036e9c>] (cpu_idle+0x9c/0x108) from [<800088b4>] (start_kernel+0x294/0x2e4)
[  172.422181] [<800088b4>] (start_kernel+0x294/0x2e4) from [<10008040>] (0x10008040)
127 | uid=0 gid=1007@nutshell:/var#[172.285647]错误:CPU上的自旋锁锁定#0、交换程序/0、983482f0
[172.291523][](从[]展开回溯+0x0/0xf8)(执行原始旋转锁定+0x100/0x164)
[172.300768][](原始旋转锁定+0x100/0x164)来自[](原始旋转锁定irqsave+0x54/0x60)
[172.310618][](原始旋转锁定irqsave+0x54/0x60)来自[](mlb_os81092_中断+0x18/0x68[os81092])
[172.321636][](mlb_os81092_中断+0x18/0x68[os81092])来自[](处理irq_事件+0x50/0x184)
[172.332781][](处理irq事件+0x50/0x184)来自[](处理irq事件+0x3c/0x5c)
[172.342622][](处理irq事件+0x3c/0x5c)来自[](处理irq级别+0xac/0xfc)
[172.351767][](句柄级别irq+0xac/0xfc)来自[](通用句柄irq+0x2c/0x40)
[172.361090][](通用irq句柄+0x2c/0x40)来自[](mx3\U gpio\U irq句柄+0x78/0x140)
[172.370843][](mx3\U gpio\U irq\U处理程序+0x78/0x140)来自[](通用处理程序\U irq+0x2c/0x40)
[172.380595][](通用句柄irq+0x2c/0x40)来自[](句柄irq+0x4c/0xac)
[172.389402][](从[]处理IRQ+0x4c/0xac)(IRQ+0x50/0xd0)
[172.397416][](irq+0x50/0xd0)从[](默认空闲+0x28/0x2c)
[172.405603][](默认空闲+0x28/0x2c)来自[](cpu空闲+0x9c/0x108)
[172.413793][](cpu空闲+0x9c/0x108)从[](启动内核+0x294/0x2e4)
[172.422181][](启动内核+0x294/0x2e4)从[](0x10008040)
[1] 这将告诉您函数调用关系。请注意以下信息: [172.310618][](原始旋转锁定irqsave+0x54/0x60)来自[](mlb_os81092_中断+0x18/0x68[os81092]) 这告诉
mlb_os81092_interrupt
函数尝试使用
spin_lock_irqsave
锁定某些内容。所以我们可以发现这个自旋锁是用来锁定什么的,并尝试分析or和日志来检测谁持有锁。然后找到了避免它的方法


[2] 另外,由于CPU0被锁定,并且可能存在MP系统,因此您应该确保是否存在可能使用关键资源的irq,如果irq的处理程序被分配给其他CPU(如CPU1),则可以,但如果CPU0处理irq的处理程序,如果您使用的是自旋锁而不是自旋锁irqsave,则会导致死锁,所以请查看。

谢谢您的详细解释!!