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 :)