From owner-freebsd-arch Fri Jan 11 1:11:26 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 12EAF37B43B for ; Fri, 11 Jan 2002 01:11:20 -0800 (PST) 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 UAA22872; Fri, 11 Jan 2002 20:10:44 +1100 Date: Fri, 11 Jan 2002 20:11:25 +1100 (EST) From: Bruce Evans X-X-Sender: To: Terry Lambert Cc: Peter Wemm , Nate Williams , Dan Eischen , Archie Cobbs , Alfred Perlstein , Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: <3C3DE998.44DCFA07@mindspring.com> Message-ID: <20020111195957.J858-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 10 Jan 2002, Terry Lambert wrote: > Bruce Evans wrote: > > Actually, userland can look at the state bit in %msw (on i386's) to > > tell if it can look at the state without trapping. However, this is > > not very useful. The state will often be in the kernel, and then > > userland will have to trap to the kernel too look at it. The trap > > may as well be a syscall that fetches all the state. > > How onerous would it be to look at the register in the kernel > before returning to user space, following a context switch? Not very, since the register has a known state following a context switch (since the kernel has just written to it :-). > I really don't think the lazy task switching FPU state saving > needs to care about threads, only about processes... and once > the bit is set, it's set, right? We don't actually do lazy switching of the FPU state (at least on i386's). We just do lazy loading of it, and forced saving of it (if it was loaded) on every context switch. So the state tends to be not in the FPU. I think it might be worth switching it for threads and letting kernel threads use it without restrictions, so that there aren't too many special cases. We already do this without really trying for ithreads. It does need to be lazy so that switching to an ithread doesn't thrash a process's context even when the ithread doesn't actually use the FPU. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message