interrupt handler
hi,
Can i use spin lock in the interrupt handler for a singlre processor machine. because books says u can not use locks but spin lock is some thing diffrent
thanks in advance
--Sanket
---------
Signature · 4 lines
Get your free email from www.linuxmail.org Powered by Outblaze
Quoted 9 lines · sanket rathi
hi,
Can i use spin lock in the interrupt handler for a singlre processor machine. because books says u can not use locks but spin lock is some thing diffrentthanks in advance
--Sanket
---------
Interrupts default to OFF within an interrupt handler. Given this, why would you use a spin-lock within the ISR on a single-processor machine?
To directly answer your question, YES, you can use a spin-lock within an ISR even though it won't do anything except add code on a single processor machine.
On multiple CPU machines, you can use the form of spin-lock that does not save/restore interrupts within the ISR, and use the save/restore versions, with the same lock variable, outside the ISR.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis.
Quoted 3 lines · Richard B. Johnson
Interrupts default to OFF within an interrupt handler. Given this, why would you use a spin-lock within the ISR on a single-processor machine?
Only the current interrupt handler is disabled... interrupts are normally ON.
Robert Love
Quoted 10 lines · Robert Love
Quoted 3 lines · Richard B. Johnson
Interrupts default to OFF within an interrupt handler. Given this, why would you use a spin-lock within the ISR on a single-processor machine?
Only the current interrupt handler is disabled... interrupts are normally ON.
Robert Love
No. Check out irq.c, line 446. The interrupts are turned back on only if the flag did not have SA_INTERRUPT set. Certainly most requests for interrupt services within drivers have SA_INTERRUPT set.
This is linux-2.4.18 or 2.4.19. If the current code, 2.5+ enables by default, it's broken and should be fixed.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis.
Quoted 8 lines · Richard B. Johnson
Quoted 2 lines · Robert Love
Only the current interrupt handler is disabled... interrupts are normally ON.
No. Check out
irq.c, line 446. The interrupts are turned back on only if the flag did not haveSA_INTERRUPTset. Certainly most requests for interrupt services within drivers haveSA_INTERRUPTset.
Sigh... SA_INTERRUPT is used only for fast interrupts. Certainly most drivers do not have it (and most that do are probably from the way old days when we went through great pains to distinguish between fast and slow interrupt handlers).
Today, very few things should run with all interrupts disabled. That is just dumb. In fact, on this system, it seems only the timer interrupt sets SA_INTERRUPT...
Robert Love
Quoted 12 lines · Robert Love
Quoted 8 lines · Richard B. Johnson
Quoted 2 lines · Robert Love
Only the current interrupt handler is disabled... interrupts are normally ON.
No. Check out
irq.c, line 446. The interrupts are turned back on only if the flag did not haveSA_INTERRUPTset. Certainly most requests for interrupt services within drivers haveSA_INTERRUPTset.
Quoted 9 lines
Sigh...
SA_INTERRUPTis used only for fast interrupts. Certainly most drivers do not have it (and most that do are probably from the way old days when we went through great pains to distinguish between fast and slow interrupt handlers).Today, very few things should run with all interrupts disabled. That is just dumb. In fact, on this system, it seems only the timer interrupt sets
SA_INTERRUPT...
And THAT makes sense as most of the timer interrupt is processed holding the write_lock() on xtime which would need to be an irq lock otherwise. If they were turned on the system would have an additional interrupts on/off overhead.
Quoted 7 lines
Robert Love
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 5 lines
George Anzinger [email protected] High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml