From owner-freebsd-ia64 Fri Nov 15 13: 5:44 2002 Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85A4D37B401 for ; Fri, 15 Nov 2002 13:05:42 -0800 (PST) Received: from kayak.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8194C43E4A for ; Fri, 15 Nov 2002 13:05:41 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from kayak.xcllnt.net (localhost [127.0.0.1]) by kayak.xcllnt.net (8.12.6/8.12.6) with ESMTP id gAFL5f0N034673; Fri, 15 Nov 2002 13:05:41 -0800 (PST) (envelope-from marcel@kayak.xcllnt.net) Received: (from marcel@localhost) by kayak.xcllnt.net (8.12.6/8.12.6/Submit) id gAFL5eBJ034672; Fri, 15 Nov 2002 13:05:40 -0800 (PST) Date: Fri, 15 Nov 2002 13:05:40 -0800 From: Marcel Moolenaar To: Doug Rabson Cc: ia64@FreeBSD.ORG Subject: Re: setjmp/longjmp and libc_r [was: Re: cvs commit: src/lib/libc/ia64/gen _setjmp.S] Message-ID: <20021115130540.A34636@kayak.xcllnt.net> References: <200211140640.gAE6eNq9016231@repoman.freebsd.org> <200211150909.32267.dfr@nlsystems.com> <20021115174328.GA4288@dhcp01.pn.xcllnt.net> <200211151955.19145.dfr@nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211151955.19145.dfr@nlsystems.com> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Nov 15, 2002 at 07:55:19PM +0000, Doug Rabson wrote: > On Friday 15 November 2002 5:43 pm, Marcel Moolenaar wrote: > > On Fri, Nov 15, 2002 at 09:09:32AM +0000, Doug Rabson wrote: > > > > > I've managed to reload my memory from magtape :-). To use > > > > > setjmp/longjmp for thread switching, you would need to call > > > > > flushrs from setjmp. That would simplify longjmp at the cost of > > > > > severely pessimising setjmp. > > > > > > > > This is exactly what we now have and what I'm willing to > > > > sacrificy at this time. It's easy enough to optimize > > > > setjmp/longjmp once we have the *context stuff. > > > > > > This is totally wrong. > > > > No, it's a step in different direction than you would have chosen. > > Pick your words with care. See also below. > > I didn't choose this direction, Intel recommends it. That's not what I mean. I don't think it's beneficial to try to explain myself. See below. > > Ah, I see. You avoid having the dirty registers on the kernel stack > > by doing an exception restore to the original stack, do a flushrs and > > then switch to the alternate stack. I wondered about this > > hoop-jumping... > > This also allows the possibility of saving/restoring the high floating > point state in user-mode instead of kernel mode which might be a good > thing in some situations. I have to think about this angle. I've been thinking about the high FPs in the context of SMP. The goal being to avoid saving the high FP in cpu_switch altogether and deal with processes moving to a different CPU in a lazy way. The same principle as avoiding the flushrs in setjmp... > > Thus: I want people to sign-up for a libc_r that uses *context before > > 5.0-RELEASE, but preferrably tomorrow. A well-intended timeline would > > be very nice... > > I want to see a libc_r which uses *context too. Its trivial to write > thread switching this way and they are designed for it (i.e. no more MD > grovelling around in the jmp_buf to setup the stack etc). I've been > using makecontext/switchcontext in my own code and it works very well. > Changing libc_r to switch this way should be easy if Dan hasn't already > done it. Ok. I guess this is the best I can get. I'll work on it this weekend. I'll restore the previous behaviour of setjmp/longjmp while I'm at it. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message