lkml.org 
[lkml]   [2003]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux kernel preemption (kernel 2.6 of course)

On Fri, 7 Nov 2003, Oleg OREL wrote:

> I was browsing linux kernel to undetsnand how kernel preemption does
> work. I was hacking around schedulee_tick and other functions called out
> of timer interrupt and was unable to found any call to schedule() or
> switch_to() to peempt currently running task, instead just mangling
> around current and inactive runqueues.

the timer interrupt indeed cannot reschedule because interrupt contexts
must never schedule. But the timer interrupt does have the ability to
reschedule the currently running task, via setting the 'need resched'
flag:

set_tsk_need_resched(p);

this flag then gets detected by the entry.S 'return from interrupt' code
[right when the timer irq returns] which then calls schedule().

ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.028 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site