From owner-freebsd-current Wed Apr 4 1:33:56 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id E652837B728; Wed, 4 Apr 2001 01:33:48 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA14053; Wed, 4 Apr 2001 18:33:45 +1000 Date: Wed, 4 Apr 2001 18:32:31 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Baldwin Cc: "David O'Brien" , current@FreeBSD.org, Mark Murray Subject: Re: i586 FP optimizations hosed. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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