Neil Horman wrote:Locking in tasklets needs to be done the same way locking in interrupt handlers is done. The only caveat that I can think of is that in the event that you are accessing data shared with code that runs outisde of the tasklet, you probably need to use spin_lock_bh to disable softirqs in the latter code. In your environment, it would typically replace the use of spin_lock_irq[save|restore].
Pierre Ossman wrote:
* Can tasklets be preempted?
A tasklet can get preempted by a hard interrupt, but tasklets run in interrupt context, so don't do anything in a tasklet that can call schedule.
Being preempted by hard interrupts is sort of the point of moving the stuff to a tasklet. Just as long as other tasklets and user space cannot preempt it.
Are there any concerns when it comes to locking and tasklets? I've tried finding kernel-locking-HOWTO referenced in kernel-docs.txt but the link is dead and I can't find a mirror.
Rgds
Pierre