Re: non-preemptive kernel

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

 



> 
>    Hi, 
>    thank for your reply and I still get some place I dont understand
> 
>         you mean the user process which is running in kernel mode will
>         not be preempted 
>    even if the time quantum is used up .That is , the preemption is
> deferred to the time when it    
>    returnto user mode, right?

that OR until it calls schedule() itself. (say when it does IO or gets
to a semaphore that is contended)

>    If so, consider a kernel thread contend for a spinlock which is
> hold by other process,
>    the kernel thread has NO chance to return to the user mode(it
> always in kernel mode)
>    will it occupy the CPU forever??

well presumably that spinlock contention is going to end, right? When it
does the kernel thread can get the spinlock and make progress again.
Kernel threads do need to sleep (eg schedule) when they have nothing to
do however... but that's a good idea in general anyway

>    if so, is it implied that the spinlock in never be used in a kernel
> thread??    

see above; that's not a correct conclusion


> 


--
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