Subject: Re: port-mips/29698: floating point context not saved in pthread/mips
To: None <port-mips-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 03/15/2005 19:24:02
The following reply was made to PR port-mips/29698; it has been noted by GNATS.
From: Martin Husemann <martin@duskware.de>
To: Jason Thorpe <thorpej@shagadelic.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-mips/29698: floating point context not saved in pthread/mips
Date: Tue, 15 Mar 2005 20:23:41 +0100
On Tue, Mar 15, 2005 at 08:38:12AM -0800, Jason Thorpe wrote:
> Unconditional save/restore of FP context on every thread switch is
> potentially quite expensive. We really need some way to tell userspace
> that a particular LWP has used the FPU.
Would userspace be able to look at the "FPU enabled" bit on all archs?
We could tweak the _*context_u() functions to use the real *context()
functions whenever this bit is enabled and the last context was a
"light" one, and do the right thing (tm) if the last context allready
was a full one. (This means passing a pre-filled context to this functions,
of course)
This sounds too easy, I'm probably missing something.
Martin
P.S.: should we move this to tech-kern?