Date: Thu, 3 Apr 2003 09:55:45 -0800 (PST) From: Nate Lawson <nate@root.org> To: Peter Wemm <peter@wemm.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 ... Message-ID: <Pine.BSF.4.21.0304030952381.14522-100000@root.org> In-Reply-To: <20030403012341.B55B32A8A7@canning.wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0304030952381.14522-100000>
