* Does the scheduler run every time jiffies is incremented?
@ 2001-04-22 14:52 Francis Litterio
2001-04-22 14:59 ` Rik van Riel
2001-04-22 15:04 ` Russell King
0 siblings, 2 replies; 3+ messages in thread
From: Francis Litterio @ 2001-04-22 14:52 UTC (permalink / raw)
To: linux-kernel
I'm reading Rubini's "Linux Device Drivers" and it isn't clear to me
whether the scheduler runs every time the timer interrupt increments
jiffies or less frequently.
Does the scheduler run every time jiffies is incremented?
--
Francis Litterio
franl@world.std.com
http://world.std.com/~franl/
PGP public keys available on keyservers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Does the scheduler run every time jiffies is incremented?
2001-04-22 14:52 Does the scheduler run every time jiffies is incremented? Francis Litterio
@ 2001-04-22 14:59 ` Rik van Riel
2001-04-22 15:04 ` Russell King
1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2001-04-22 14:59 UTC (permalink / raw)
To: Francis Litterio; +Cc: linux-kernel, kernelnewbies
[please remove linux-kernel from the CC and move it to the
more appropriate kernelnewbies list]
On 22 Apr 2001, Francis Litterio wrote:
> I'm reading Rubini's "Linux Device Drivers" and it isn't clear to me
> whether the scheduler runs every time the timer interrupt increments
> jiffies or less frequently.
>
> Does the scheduler run every time jiffies is incremented?
No. Every timer interrupt a bunch of functions in
kernel/timer.c is run, amongst them the following lines
of code (from update_process_times):
if (--p->counter <= 0) {
p->counter = 0;
p->need_resched = 1;
}
As you can see, we will only reschedule when the time slice
of the currently running process is over.
regards,
Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Does the scheduler run every time jiffies is incremented?
2001-04-22 14:52 Does the scheduler run every time jiffies is incremented? Francis Litterio
2001-04-22 14:59 ` Rik van Riel
@ 2001-04-22 15:04 ` Russell King
1 sibling, 0 replies; 3+ messages in thread
From: Russell King @ 2001-04-22 15:04 UTC (permalink / raw)
To: Francis Litterio; +Cc: linux-kernel
On Sun, Apr 22, 2001 at 10:52:15AM -0400, Francis Litterio wrote:
> Does the scheduler run every time jiffies is incremented?
No, it runs when something needs to be rescheduled (ie, when
the current tasks need_resched element (current->need_resched) is set).
This typically happens when someone wakes up, or the task reaches the
end of its allotted quantum.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-04-22 15:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-22 14:52 Does the scheduler run every time jiffies is incremented? Francis Litterio
2001-04-22 14:59 ` Rik van Riel
2001-04-22 15:04 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox