From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 2 21:31:33 2007 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C293B16A41A; Tue, 2 Oct 2007 21:31:33 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 728C813C461; Tue, 2 Oct 2007 21:31:33 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.103] (c-67-160-44-208.hsd1.wa.comcast.net [67.160.44.208]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l92LVV5g086465 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Tue, 2 Oct 2007 17:31:32 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Tue, 2 Oct 2007 14:34:19 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: Peter Grehan In-Reply-To: <4702AB13.3060003@freebsd.org> Message-ID: <20071002142856.K594@10.0.0.1> References: <200709271639.l8RGdREd032105@repoman.freebsd.org> <46FBDFE8.9050909@freebsd.org> <20070930153101.T583@10.0.0.1> <47004ACF.5020901@freebsd.org> <20070930184601.R583@10.0.0.1> <4702AB13.3060003@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-ppc@freebsd.org Subject: Re: cvs commit: src/sys/kern sched_ule.c X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2007 21:31:33 -0000 On Tue, 2 Oct 2007, Peter Grehan wrote: > Hi Jeff, > >> If you can test ULE on UP arm/powerpc I'd appreciate it. > > Works fine on ppc after some minor tweaks. I've attached the diff for those > interested. A couple of questions: > > - Can ULE work without preemption ? When it wasn't enabled, the system > wouldn't switch out of the idle loop. There's a comment in sched_idletd(): It always must use preemption with idletd. You can disable it in all other cases by omitting the PREEMPTION option... Ah I see the bug now. I only tested by adjusting kern.sched.preempt_thresh. I didn't notice that the code in critical_exit() is conditional. I'll fix that so it should work without PREEMPTION. > > /* ULE relies on preemption for idle interruption. */ > > I'm asking because PREEMPTION has never been switched on in PPC, and it > might be nice to enable ULE without having to determine if bugs are in > PREEMPTION or ULE. Once I fix critical_exit() it should only preempt idle which is unlikely to cause bugs, except perhaps in your cpu_idle implementation. > > - ppc's cpu_throw() was implemented in C. I modified it to pass the > thread-lock mutex from the old thread, so the context switch routine would > simply write it back. Is that an OK thing to do ? Yes, that's fine. Thanks! Jeff > > later, > > Peter. >