RE: Premptive vs non-premptive kernel.

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

 



On Fri, 2004-06-25 at 16:49 +0530, Dhiman, Gaurav wrote:

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

This is not true.

need_resched is a flag in the process's thread_info struct.  It is per-
process, for performance reasons.

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

Yes, this is basically what it does.  The interrupts have to know
whether to jump back to a kernel address or mode switch back to user-
space, so there are different code paths.

	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