Kernel preemption of BH handler
Subsystems (2)
I have a BH handler that processes packets received from a netdevice.
my_bh_handler() {
spin_lock_bh(my_lock);
/*do stuff*/
spin_unlock_bh(my_lock);
/*do more stuff*/
}
First packet is received, and my_bh_handler() is currently processing it.
Now a new packet is received by the NIC and my_bh_handler() is preempted after my_lock have been released.
Is it possible that the second invocation of the BH routine is allowed to finish before the first?
//E
Quoted 8 lines · Erik Hugne
I have a BH handler that processes packets received from a netdevice.
my_bh_handler() { spin_lock_bh(my_lock); /*do stuff*/ spin_unlock_bh(my_lock); /*do more stuff*/ }
spin_lock_bh() means 'spin lock with contending soft-interrupts' and not 'spin lock from a soft-interrupt'. You probably need to use it in process context but not here.
Quoted 3 lines
First packet is received, and
my_bh_handler()is currently processing it. Now a new packet is received by the NIC andmy_bh_handler()is preempted aftermy_lockhave been released.
You don't explain how this handler is invoked, but normally it would be scheduled to run a second time and would not preempt the first call.
Ben.
Quoted 2 lines
Is it possible that the second invocation of the BH routine is allowed to finish before the first?
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.