From owner-freebsd-hackers Tue Nov 11 15:34:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA03865 for hackers-outgoing; Tue, 11 Nov 1997 15:34:38 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from kinclaith.pdl.cs.cmu.edu (KINCLAITH.PDL.CS.CMU.EDU [128.2.189.18]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id PAA03845 for ; Tue, 11 Nov 1997 15:34:30 -0800 (PST) (envelope-from dpetrou@kinclaith.pdl.cs.cmu.edu) Message-Id: <199711112334.PAA03845@hub.freebsd.org> Subject: Why no priority check before need_resched() in wakeup()? To: freebsd-hackers@freebsd.org Date: Tue, 11 Nov 1997 18:34:12 -0500 (EST) From: David Petrou X-Mailer: ELM [version 2.4 PL25-40] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Inside wakeup() and wakeup_one() there's a section of code with a comment that reads: /* OPTIMIZED EXPANSION OF setrunnable(p); */. This piece of code (among other things) marks a process as runnable and calls setrunqueue(). It also unconditionally calls need_resched() so that the scheduler will be invoked when leaving the kernel. My question is this: Why does this expansion of setrunnable() NOT check to see if the process's priority is better than the priority of the currently running process before calling need_resched()? If you look at the code for setrunnable(), you'll see that the check is there. Thanks, David