Re: Premptive vs non-premptive kernel.

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

 



Robert Love wrote:

A couple corrections:

The timer interrupt does the timeslice check as you describe in the same
manner, whether or not CONFIG_PREEMPT is enabled.  It simply sets the
need_resched flag.

The actual preemption occurs when the timer interrupt returns (it
actually occurs when any interrupt returns).  If need_resched is set,
the interrupt handler will invoke the scheduler to choose a new task.


> "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 ?, 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 ?


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

cheers,
Amith




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