RE: Spinlocks on Uniprocessor

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

 



From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of richard bravo
Sent: Friday, September 21, 2007 3:15 PM
To: Rajendra Stalekar; 'jiayinjia1983116'; 'Mansha Linux'
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: RE: Spinlocks on Uniprocessor

 

In UP machines Spinlocks are compiled away, so that it only disables interrupts on spin_lock_irqsave and enables interrupts on spin_lock_irqrestore. This protects the critical section the code executing in process context and interrupt routine. Pls correct me if I am wrong.

[rajendra stalekar] AFAIK, spinlocks anyway disable interrupts, however, once it gets unlocked it enables it. The reason why we call spin_lock_irqsave could be that , if the interrupt did comes by, it would be kept pending and then once it i.e. spin_lock_irqrestore , it will invoke the interrupt handler.

Please let me know if I am right on this


Rajendra Stalekar <rajendra.stalekar@xxxxxxxxx> wrote:

 

 


From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of jiayinjia1983116
Sent: Thursday, September 20, 2007 11:06 AM
To: Mansha Linux
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re:Spinlocks on Uniprocessor

 

As for as I know,when process/Thread is in runqueue,then may have allocate some resource even they do not running right now,In order to keep the data consistent(can not be modified by other processes/threads) ,we should use spinlock to protect the data.

 

[rajendra stalekar] > I think that the code protected by spinlock must never have a blocking call(eg. copy_to_user, copy_from_user, read, write etc), whenever a thread acquires a spinlock whatever the critical section code has to be asynchronous and yes of course kernel must be pre-emptible.

 


ÔÚ2007-09-19£¬"Mansha Linux" <mansha.linux@xxxxxxxxx> £º


Hi all,

Could  you please explain me why do we need the spinlocks on uniprocessor machines?
Is this the only reason that the kernel is preemptive ?
--
regards,
Mansha

 


ɱ70ÍòÖÖľÂí²¡¶¾£¬ÈðÐÇ2008°æÃâ·Ñ


http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@xxxxxxxxx and delete this mail.
_____________________________________________________________________

 

 


Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.


http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@xxxxxxxxx and delete this mail.
_____________________________________________________________________

[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