Subject: Re: halving context switch time
To: David Laight <david@l8s.co.uk>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-i386
Date: 08/22/2002 12:55:19
On Thu, 22 Aug 2002, David Laight wrote:

> On Wed, Aug 21, 2002 at 09:00:04PM -0700, Bill Studenmund wrote:
> >
> > Why not just change cpu_switch to return if it entered or not? That seems
> > to be the cleanest solution.
>
> Cleanest yes, but I barfed at the relevant change to the asm
> code.  There isn't a free register lurking to carry the info
> across the 'process switch in' code.
>
> An alternative would to be to call microtime() from inside
> the idle loop code (ie when it exits).
>
> One itsy problem is that the cpu_switch() function for every
> port would need changing.....

So?

It sounds like every port will benefit from this change. microtime() isn't
free, so each port will be better off if it can call it only once.
Admittedly some ports might not have the drastic speedup you mention for
i386, but a call is a call. :-)

Also, cpu_switch() is an MI function. Any changes need to also be MI. An
i386-only change (unless there is a REALLY good reason) won't fly for MI
code.

Take care,

Bill