Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2001 18:32:31 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        "David O'Brien" <obrien@FreeBSD.org>, current@FreeBSD.org, Mark Murray <mark@grondar.za>
Subject:   Re: i586 FP optimizations hosed.
Message-ID:  <Pine.BSF.4.21.0104041820500.38711-100000@besplex.bde.org>
In-Reply-To: <XFMail.010403091533.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 3 Apr 2001, John Baldwin wrote:

> On 03-Apr-01 Bruce Evans wrote:
> > There are many other possibilities:
> > ...
> > - don't attempt to save the FPU state reentrantly, since this doesn't work
> >   with preemptive context switchiing unless interrupt handlers also save the
> >   state reentrantly, which they shouldn't do because it is too wasteful.
> >   Instead, save the state in the pcb as is already done in copy{in,out}
> >   so that cpu_switch() handles it.  This may be too wasteful too.
> > - as in previous possibility, but avoid switching the entire state.  For
> >   the FPU, the entire state must be switched, but for SSE individual
> >   registers can be saved and restored.  Saving and restoring individual
> >   registers reentrantly would be easy but no longer works for the SMP case.
> >   Switching a subset of the state would not be so easy.
> 
> Hmmmmm.  I think I'm liking the next to last.  Even if there is additional
> overhead, it should still outperform generic_bcopy and friends on the CPU's in
> question, right?

Not clear.  We now have heavyweight context switches that switch the FPU
for every interrupt.  If we make switching the FPU for ithreads fundamental
instead of a just source of bugs, then it will be harder to implement
lightweight context switches for ithreads (context switches won't be
lightweight if they switch the FPU, and we might have to do extra work
to avoid them).  Also, if the FPU is actually used a lot, then it will
have to be switched a lot.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0104041820500.38711-100000>