spin_lock_bh and spin_lock_irqsave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

As far as I understand, spin_lock_bh will disable all softirqs and spin_lock_irqsave will disable all interrupts and save the flags.

#1.
- One interesting I found is that many drivers use spin_lock_irqsave in their ioctl and their bottom-half routine rather than spin_lock_bh in even bottom-half. Why isn't spin_lock_bh used?

#2.
- As long as a section is processed between spin_lock_irqsave and spin_unlock_irqrestore, I understand no interrupt routine cannot interrupt between them. Am I correct?

#3.
- If a section is processed between spin_lock_bh and spin_unlock_bh, is it possible that an interrupt such like timer (NMI) interrupt can interrupt between them? If that, when it returns back to the critical section between spin_lock_bh and spin_unlock_bh, is there a possibility a memory or register can be broken?

Could you help me to confirm if I know correctly?

Thank you,

Daniel

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux