Re: Premptive vs non-premptive kernel.

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

 



On Fri, 2004-06-25 at 12:07 +0530, amith wrote:

>  >    "if need_resched is set" -  when executing in kernel mode , if an 
> interrupt occurs, the ISR is called ,  once ISR is executed , where is 
> need_resched set ?,

need_resched is set in a few places, noting that a task should run in
lieu of the current one.  The most notable is scheduler_tick(), which is
called from the timer interrupt handler.  It sets need_resched when a
task's timeslice reaches zero.

> and how does the ISR know the process context where 
> the CPU was executing earlier i.e to set need_resched in the 
> corresponding task_struct ?

Because it knows what process it interrupted.  'current' is still valid.

>  > "the interrupt handler will invoke the scheduler to choose a new 
> task"  does the timer ISR have the process context of the process which 
> got interrupted , if no , then how is need_reched set for the 
> interrupted process ?

Yes.

	Robert Love



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