Re: spin_lock_irq / spin_lock_irqsave ??

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

 




On 6/7/07, keshetti85-linux@xxxxxxxxxxx <keshetti85-linux@xxxxxxxxxxx > wrote:
Hi list,

Can anybody tell me what is the intended use of the spin_lock_irqsave?

This helps prevent deadlocks where the code is potentially accessed from interrupt context also.

The only extra thing spn_lock_irqsave does when compared to spin_lock_irq is,
it saves the current context(?) in some variable. But why is it required at all?

Actually spin_lock_irqsave saves the current interrupt flags, and ALSO disables interrupts.

"local_irq_save" - which is called by spin_lock_irqsave - has the "cli" instruction which does the disabling part.

Isn't it done by the kernel??

Spinlocks are used in the kernel only, so I kinda missed the point here. Can you rephrase?

Thanks and regards,
Mahesh.

Bhanu.
 
--
The box said "Requires Windows Vista or better." So I installed LINUX

[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