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/