Re: spinlock on uniprocessor systems

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

 



On 2/1/06, Mukund JB. <mukundjb@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Dear Fawad,
>
> What I can understand from the following description given by you is:
>
> The spinlock if implemented on a Uniprocessor non-preemptable kernel
> will lead to kernel crash.
> REASON:
> The second process will be in busy loop not allowing the Scheduler to
> schedule the task. It will hang.
>
> My questions:
> scheduler_tick() is a called at regular system routine that the kernel
> periodically calls and marks processes as needing rescheduling. This
> call occurs in the timer interrupt context.
>
> Now, Lets say that the second process (B) called the spinlock_lock() and
> is waiting for the first process (A) to unlock. In the mean time, it is
> sure that scheduler_tick()will be invoked in timer interrupt context.
> This should take care of the rescheduling the task with this new Process
> B. Then where is the case of system getting hanged completely.
>
> Pleas help me get more clarity on this.
>

AFAIK in kernel without preemption and no SMP the process (kernel
process) will never be rescheduled until unless it voluntarily call
schedule or releases CPU. You can see this behaviour by just inserting
while(1); (infinite loop) with-in your module and your system will
hang !  (CMIIW)


--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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