admin管理员组文章数量:1422029
I have a kernel module that is processing packets.
I have one tasklet that is running and will read from a list that has a spin_lock.
There is a workqueue that is also reading from the same list.
After sending lots of data i get
watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [kworker/0:1:14] beginning of dump is this:
Workqueue: events my_work_fn [mymodule]
PC is at _raw_spin_lock+0x3c/0x50
LR is at destFind+0x24/0xcc [mymodule]
The destFind method needs to use the spin_lock. Both workqueue and taskelt call this.
My theory is that the tasklet processing pkt is hogging the spin_lock by calling it all the time. i.e. lock-unlock-lock-unlock, etc...
Could this cause the work fcn to never get to acquire the spin_lock?
part of dump after register dump is this:
Control: 18c5387d Table: 0443c04a DAC: 00000051
_raw_spin_lock from destFind+0x24/0xcc [mymodule]
destFind [mymodule] from initPacket_intasklet+0x520/0x604 [mymodule]
initPacket_intasklet [mymodule] from mymodule_tasklet_handler+0x2c/0x64 [mymodule]
The initPacket is what gets called from tasklet and runs alot when processing packets.
I am on a dual core arm.
I have a kernel module that is processing packets.
I have one tasklet that is running and will read from a list that has a spin_lock.
There is a workqueue that is also reading from the same list.
After sending lots of data i get
watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [kworker/0:1:14] beginning of dump is this:
Workqueue: events my_work_fn [mymodule]
PC is at _raw_spin_lock+0x3c/0x50
LR is at destFind+0x24/0xcc [mymodule]
The destFind method needs to use the spin_lock. Both workqueue and taskelt call this.
My theory is that the tasklet processing pkt is hogging the spin_lock by calling it all the time. i.e. lock-unlock-lock-unlock, etc...
Could this cause the work fcn to never get to acquire the spin_lock?
part of dump after register dump is this:
Control: 18c5387d Table: 0443c04a DAC: 00000051
_raw_spin_lock from destFind+0x24/0xcc [mymodule]
destFind [mymodule] from initPacket_intasklet+0x520/0x604 [mymodule]
initPacket_intasklet [mymodule] from mymodule_tasklet_handler+0x2c/0x64 [mymodule]
The initPacket is what gets called from tasklet and runs alot when processing packets.
I am on a dual core arm.
Share Improve this question edited Jan 17 at 16:43 RookieBeotch asked Jan 17 at 16:33 RookieBeotchRookieBeotch 1031 silver badge7 bronze badges1 Answer
Reset to default 0i was able to fix this using read write lock instead of regular spin lock.
since both of the functions are just reading and not writing it makes a lot of sense having the read lock instead.
like usual i learned something after i post it :)
本文标签: kernel moduleThreads and spinlock Soft LockupStack Overflow
版权声明:本文标题:kernel module - Threads and spin_lock Soft Lockup - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745355047a2654998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论