From owner-cvs-all@FreeBSD.ORG Thu Apr 3 11:24:52 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2251637B401; Thu, 3 Apr 2003 11:24:52 -0800 (PST) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69B9C43FA3; Thu, 3 Apr 2003 11:24:50 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.9/8.12.9) with ESMTP id h33JOnMS005051 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 3 Apr 2003 14:24:49 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id h33JOic32561; Thu, 3 Apr 2003 14:24:44 -0500 (EST) (envelope-from gallatin@cs.duke.edu) Date: Thu, 3 Apr 2003 14:24:44 -0500 From: Andrew Gallatin To: Peter Wemm Message-ID: <20030403142444.A32536@grasshopper.cs.duke.edu> References: <20030403012341.B55B32A8A7@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030403012341.B55B32A8A7@canning.wemm.org>; from peter@wemm.org on Wed, Apr 02, 2003 at 05:23:41PM -0800 X-Operating-System: FreeBSD 4.4-RELEASE on an i386 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Nate Lawson Subject: Re: cvs commit: src/sys/conf options.i386 src/sys/i386/i386 machdep.c mp_machdep.c pmap.c swtch.s src/sys/i386/include md_var.h pmap.h smp.h src/sys/i386/isa apic_vector.s intr_machdep.h src/sys/kern kern_switch.c kern_synch.c kern_thr.c kern_thread.c subr_witness.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2003 19:24:52 -0000 Peter Wemm [peter@wemm.org] wrote: > Nate Lawson wrote: <..> > > Shouldn't there be a "if (thread == curthread) return;" in the scheduling > > code somewhere? > > There is now. :-) > > newtd = choosethread(); > if (td != newtd) > cpu_switch(td, newtd); /* SHAZAM!! */ > #ifdef SWTCH_OPTIM_STATS > else > stupid_switch++; > #endif > > sparc64's cpu_switch() already optimized this case. i386 didn't. I haven't > checked alpha/ia64 yet, but they're still using the old no-args API. I think alpha has this feature: LEAF(cpu_switch, 1) <..> CALL(choosethread) /* can't return NULL */ mov v0, s2 /* s2 = new thread */ ldq s3, TD_MD_PCBPADDR(s2) /* s3 = new pcbpaddr */ /* * Check to see if we're switching to ourself. If we are, * don't bother loading the new context. <..> cmpeq s0, s2, t0 /* oldthread == newthread? */ bne t0, Lcs7 /* Yes! Skip! */ Drew