From owner-cvs-src@FreeBSD.ORG Tue Aug 10 15:19:57 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 044D516A4CE for ; Tue, 10 Aug 2004 15:19:56 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85F4D43D4C for ; Tue, 10 Aug 2004 15:19:56 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7154 invoked from network); 10 Aug 2004 15:19:56 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 10 Aug 2004 15:19:55 -0000 Received: from 10.50.40.208 (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i7AFJpen083739; Tue, 10 Aug 2004 11:19:52 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Jeff Roberson Date: Tue, 10 Aug 2004 09:18:45 -0400 User-Agent: KMail/1.6 References: <200408100752.i7A7qMYI000506@repoman.freebsd.org> In-Reply-To: <200408100752.i7A7qMYI000506@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408100918.45387.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern sched_ule.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2004 15:19:57 -0000 On Tuesday 10 August 2004 03:52 am, Jeff Roberson wrote: > jeff 2004-08-10 07:52:22 UTC > > FreeBSD src repository > > Modified files: > sys/kern sched_ule.c > Log: > - Use a new flag, KEF_XFERABLE, to record with certainty that this kse > had contributed to the transferable load count. This prevents any > potential problems with sched_pin() being used around calls to > setrunqueue(). - Change the sched_add() load balancing algorithm to try to > migrate on wakeup. This attempts to place threads that communicate with > each other on the same CPU. > - Don't clear the idle counts in kseq_transfer(), let the cpus do that > when they call sched_add() from kseq_assign(). > - Correct a few out of date comments. > - Make sure the ke_cpu field is correct when we preempt. > - Call kseq_assign() from sched_clock() to catch any assignments that > were done without IPI. Presently all assignments are done with an IPI, but > I'm trying a patch that limits that. > - Don't migrate a thread if it is still runnable in sched_add(). > Previously, this could only happen for KSE threads, but due to changes to > sched_switch() all threads went through this path. > - Remove some code that was added with preemption but is not necessary. Couple of comments: 1) TDF_NEEDRESCHED is still needed as that is what manages user-level preemptions. Kernel preemption does not normally preempt threads at user-level priorities (see the code in maybe_preempt() for a comment with more detailed info). 2) Can a thread bound to CPU B ever be put on the runqueue via setrunqueue() by a thread on CPU A? If so, you need to keep the SMP-specific migration check before the call to maybe_preempt() so that you don't end up running the new thread on CPU A even though it is supposed to run on CPU B. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org