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/