Linux supplementary primitive, interrupt, soft interrupt

  
 

Resolve the problem that up may access a non-existent data structure (release semaphore after down): See in depth 3, page216-217.1. completion() corresponds to up()2. wait_for_completion() corresponds to down and semaphore The difference is that the spin lock of the completion wait queue ensures that completion() and wait_for_completion() are not concurrent, and the semaphore is used to avoid down() concurrent execution of the disable: local_irq_disable(), local_irq_save() enables interrupts: local_irq_enable() , local_irq_restore() disables deferrable functions: local_bh_disable() enables deferrable functions: locaLbh_enable() soft interrupts and delayable functions (tasklets) run in interrupt context (activated at the end of hardware interrupt processing), of course, by disabling interrupts The way is forbidden, but sometimes we still want the CPU to respond to the interrupt. This is the soft interrupt counter in the available preempty field. If it is positive, it will not execute the soft interrupt without executing (local_bh_disable() adds 1 to the value)

Copyright © Windows knowledge All Rights Reserved