Date: Wed, 24 Jan 2007 15:49:49 +0800 From: David Xu <davidxu@freebsd.org> To: Jeff Roberson <jroberson@chesapeake.net> Cc: src-committers@FreeBSD.org, jhb@FreeBSD.org, cvs-src@FreeBSD.org, Jeff Roberson <jeff@FreeBSD.org>, cvs-all@FreeBSD.org, Julian Elischer <julian@FreeBSD.org> Subject: Re: cvs commit: src/sys/kern sched_ule.c Message-ID: <45B70F9D.7090203@freebsd.org> In-Reply-To: <20070123220934.H564@10.0.0.1> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45B70F9D.7090203>