Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 22 Apr 2001 11:05:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 22 Apr 2001 11:04:58 -0400 Received: from garrincha.netbank.com.br ([200.203.199.88]:47626 "HELO netbank.com.br") by vger.kernel.org with SMTP id ; Sun, 22 Apr 2001 11:04:53 -0400 Date: Sun, 22 Apr 2001 11:59:11 -0300 (BRST) From: Rik van Riel To: Francis Litterio Cc: linux-kernel@vger.kernel.org, kernelnewbies@nl.linux.org Subject: Re: Does the scheduler run every time jiffies is incremented? In-Reply-To: Message-ID: X-spambait: aardvark@kernelnewbies.org X-spammeplease: aardvark@nl.linux.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org [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/ - 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/