From owner-cvs-all@FreeBSD.ORG Thu Apr 3 09:55:46 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 73D3E37B401 for ; Thu, 3 Apr 2003 09:55:46 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 46B9443FBD for ; Thu, 3 Apr 2003 09:55:45 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 14543 invoked by uid 1000); 3 Apr 2003 17:55:46 -0000 Date: Thu, 3 Apr 2003 09:55:45 -0800 (PST) From: Nate Lawson To: Peter Wemm In-Reply-To: <20030403012341.B55B32A8A7@canning.wemm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/conf options.i386 src/sys/i386/i386machdep.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 17:55:47 -0000 On Wed, 2 Apr 2003, Peter Wemm 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. The more things change... "Probably 30% of the performance improvements came from fixing things in the Sun kernel. I mean like, really, guys: If the current task doesn't change, and it doesn't 80% of the time swtch is called, there's no need to do a full context save and restore. Adding the two lines cmpl _masterprocp,a0 jeq 6f restore of current proc is easy just before the call to "resume" in sun3/vax.s:swtch got me a quick 70 KB/s performance increase but felt more like a bug fix than progress." -- van http://www.root.org/ip-development/news/vanj.88jul20.txt -Nate