From owner-freebsd-threads@FreeBSD.ORG Thu Nov 27 11:03:39 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 A508816A4CE; Thu, 27 Nov 2003 11:03:39 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88AFE43FE0; Thu, 27 Nov 2003 11:03:37 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id hARJ3bEG051089; Thu, 27 Nov 2003 11:03:37 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) hARJ3bWx014957; Thu, 27 Nov 2003 11:03:37 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.10/8.12.10/Submit) id hARJ3bW0014956; Thu, 27 Nov 2003 11:03:37 -0800 (PST) (envelope-from marcel) Date: Thu, 27 Nov 2003 11:03:37 -0800 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20031127190337.GB14849@dhcp01.pn.xcllnt.net> References: <20031127055545.GB12712@dhcp01.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: threads@freebsd.org Subject: Re: KSE/ia64 & thr_spinlock.c:1.18: problem identified 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: Thu, 27 Nov 2003 19:03:39 -0000 On Thu, Nov 27, 2003 at 10:07:25AM -0500, Daniel Eischen wrote: > On Wed, 26 Nov 2003, Marcel Moolenaar wrote: > > > Ok, > > > > I found what the problem is. Syscalls that got interrupted were not > > restarted when they should be. This is the result of using the KSE > > internal context functions, when we should be going through the > > kernel. So, the end result is that we do in fact need a syscall to > > switch KSE contexts. Attached a patch to add such syscall. Please > > review (ia64 specific changes to make use of the syscall are not > > included). > > The patch looks OK. Is it possible to roll _ia64_break_setcontext() > into kse_switchin() and have ia64's set_mcontext() know the difference > between the two contexts? I'm working on it. I had this done right from the start after creating the syscall, but it reintroduced old failures related to asynchronous contexts. So, my working version now has 3 ways to restore a context (_ia64_break_setcontext(), _ia64_restore_context() and kse_switchin()) and it demonstrates that the problem was indeed that we were using _ia64_restore_context() in cases where this would be invalid. So yes, the next step is to remove the ia64_break_setcontext() hack and use kse_switchin() for asynchronous contexts as well. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net