Dhiman, Gaurav wrote:
Hi Amith,
Answer for your second question:
need_resched is not something specific to a particular process and is not a part of task_struct, its global to kernel and is set by timer interrupt whenever the timer interrupt finds that the time allocated to current process (represented by 'current' pointer) has expired.
Your first question is my question also, How the returning code of any interrupt finds whether the control is returning to user space or kernel space? As far as I think, it must be checking if the return address falls in kernel address range or in user address range. Can someone give the detailed insight about this?
Regards, Gaurav Dhiman.
hi Gaurav,
but i find :
struct task_struct { ..... ...... volatile unsigned long need_resched; .... .... ... };
and where is need_resched which sounds/seems to be global ?? but i couldnt find it anywhere in the sources . i could find one in task_struct only as metntioned before (sched.h) .
cheers, Amith
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/