From owner-freebsd-threads@FreeBSD.ORG Wed Aug 6 15:04:56 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F01037B401; Wed, 6 Aug 2003 15:04:56 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id C435943F75; Wed, 6 Aug 2003 15:04:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h76M4LwO040288; Wed, 6 Aug 2003 15:04:21 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h76M4LG0001499; Wed, 6 Aug 2003 15:04:21 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h76M4Ll4001498; Wed, 6 Aug 2003 15:04:21 -0700 (PDT) (envelope-from marcel) Date: Wed, 6 Aug 2003 15:04:21 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030806220421.GA1404@athlon.pn.xcllnt.net> References: <20030806205308.GA1179@athlon.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: threads@freebsd.org Subject: Re: KSE/ia64: a quick update X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 22:04:56 -0000 On Wed, Aug 06, 2003 at 02:42:45PM -0700, Julian Elischer wrote: > > Originally we would not do an upcall unless the > kernel was neterred from a syscall, however David added soem code so > that at a clock interrupt, if the mailbox indicates that it has had > enough time, An UPCALL context is belatedly made and saved and an upcall > results.. Ah, so I have David to thank for the added complexity... :-) > > But both are async frames on alpha. The only difference is the > > layout, not what's put in it. On ia64 the layout is always the > > same, but we don't populate everything all the time. > > So how does a returning thread know what to restore? So far it has always been a sync context, so all that needed to be restored were the special and the preserved registers. I added the return registers just recently. The sync contexts don't have any optional fields. It's the async contexts that make things complicated. I just have to add flags and/or actually use the flags that have been defined already. > > Yes. That too. I had a brainwave: We still support the old > > syscall path, which is based on the break instruction. It's > > a trap. So, we can use the break instruction to trap into > > the kernel, executing the setcontext() syscall and go back > > to the interrupted context without any hackery. This at > > least resolves the problem of having 2 paths into the > > kernel: we take a trap to restore a context created by > > a trap. I guess I won't obsolete the old syscalls anymore :-) > > > > Alas, I forgot about the mailbox pointer... We don't have a > > syscall for that. I could probably put the info in the context > > itself, set a flag and enhance setcontext() to do it atomically > > as a possibly undocumented feature/extension to support KSE. > > Hmmm... > > you're somewhere near here now aren't you? > (I think you said san Mateo but I could be wrong) I live in Mountain View. San Mateo relates to BSDcon. > Maybe we could get to gether some time and walk through > this.. A whiteboard is always easier to understand. That's probably not a bad idea. I'll this off-list, unless it's beneficial for others as well and we can meet with one or two more. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net