From owner-cvs-src@FreeBSD.ORG Wed Jan 24 07:49:51 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id AF5F216A403; Wed, 24 Jan 2007 07:49:40 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <45B70F9D.7090203@freebsd.org> Date: Wed, 24 Jan 2007 15:49:49 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061204 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Roberson References: <200701230850.l0N8oZV2065483@repoman.freebsd.org> <200701241147.17846.davidxu@freebsd.org> <20070123200041.Y564@10.0.0.1> <45B6E2A5.6080404@freebsd.org> <20070123220934.H564@10.0.0.1> In-Reply-To: <20070123220934.H564@10.0.0.1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, jhb@FreeBSD.org, cvs-src@FreeBSD.org, Jeff Roberson , cvs-all@FreeBSD.org, Julian Elischer Subject: Re: cvs commit: src/sys/kern sched_ule.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 24 Jan 2007 07:49:51 -0000 Jeff Roberson wrote: > On Wed, 24 Jan 2007, David Xu wrote: > >> Jeff Roberson wrote: >> >>>> if idlethread is preempted, who will clear its idle bit in >>>> idle_cpus_mask ? >>> >>> >>> >>> idle_cpus_mask was broken before for all schedulers. This commit >>> didn't change that. ULE doesn't use idle_cpus_mask and it's >>> idlethread doesn't set or clear it. The idle thread for the other >>> schedulers remains unchanged. >>> >> I havn't read ULE code, but 4BSD has following code: >> > > This is the very same code that was there before. I didn't change it. > I just moved it into the schedulers. It was always broken with > preemption. I tried to use idle_cpus_mask in ULE but found that it > always was set for most CPUs. You will find that IPI_PREEMPT also had > no effect but I fixed that recently. > orignal code does not preempt per-cpu idle thread, so the idle threads have chance to clear their idle bits in idle_cpu_masks, but now because the threads can be preempted directly, so they don't have chance to clear the masks, unless sched_switch clears them( but the code is not there), without clearing them, very cpu will receive a broadcast IPI whenever a thread is added to runqueue for 4BSD scheduler, this is incorrect if a cpu is already running a non-idle thread.