Re: Spinlock on single-processor machines

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

 



On 7/25/06, s prashant <sprashant16@xxxxxxxxx> wrote:
On 7/25/06, Gaurav Dhiman < gauravd.chd@xxxxxxxxx> wrote:
May I know where you read this. It does not seems ok to me.
I agree with your view point.

Gaurav

Operating system comcepts (7th edition), page 221
 

On 7/25/06, Grob Team <grobteam@xxxxxxxxx> wrote:
>
> Hi,
>
> I've read that on single-processor machines rather than holding a spinlock,
> the kernel disables kernel preemption (2.6). However, it seems that
> interrupts are still enabled so if an interrupt occured and call the
> function who is suposed to contain the spinlock, we will have data
> consistency problem since the function who has been interrupted was doing
> something in the critical region and the isr is doing something in the
> critical region too. Someone can explain me what I dont understand?
>
> Thank you
>


--
Gaurav
Email: gauravd.chd@xxxxxxxxx



There are quite a few variants of spin locks.
1.spin_lock  
  spin_unlock

 The above ones are used when you know the critical section that
 you are protecting will not accessed from an interrupt handler.
 In case of uniprocessor  m/c  these locks are not effective as they
 compile away to nothing.

2.spin_lock_irqsave
  spin_unlock_irqrestore
 These locks also disable the interrrupts.

do refer "kernelsources/Documentation/spinlocks.txt" for further details.


Thank you :)


[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