Re: Spinlocks
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 10/18/05
- Next message: Sagar Borikar: "Re: Spinlocks"
- Previous message: Peter T. Breuer: "Re: mounting external hard drive on linux"
- In reply to: brankok_at_dkts.co.yu: "Spinlocks"
- Next in thread: Peter T. Breuer: "Re: Spinlocks"
- Reply: Peter T. Breuer: "Re: Spinlocks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 18 Oct 2005 12:13:01 +0200
brankok@dkts.co.yu wrote:
>
> Now I'm wondering if I should have used spinlocks at
> all. Couldn't I have just disable interrupts in in the noninterrupt
> code, do the critical section and then enable interrupts? What am I not
> getting?
Multi CPU systems.
Even if you disable interrupts on one CPU it may still be taken
by another CPU. So you need to disable interrupts to protect
against interrupts on the same CPU and the spinlock to protect
against other CPUs. This is exactly what spinlock_irqsave will
take care of. (In configurations where the spinlock part is not
required, it will be excluded automatically, so you don't need
to worry about that).
-- Kasper Dupont Note to self: Don't try to allocate 256000 pages with GFP_KERNEL on x86.
- Next message: Sagar Borikar: "Re: Spinlocks"
- Previous message: Peter T. Breuer: "Re: mounting external hard drive on linux"
- In reply to: brankok_at_dkts.co.yu: "Spinlocks"
- Next in thread: Peter T. Breuer: "Re: Spinlocks"
- Reply: Peter T. Breuer: "Re: Spinlocks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
Loading