From owner-freebsd-threads@FreeBSD.ORG Thu Apr 17 10:19:45 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 1DD8737B401 for ; Thu, 17 Apr 2003 10:19:43 -0700 (PDT) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DBC843FE3 for ; Thu, 17 Apr 2003 10:19:42 -0700 (PDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h3HHJco28615; Thu, 17 Apr 2003 13:19:38 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Thu, 17 Apr 2003 13:19:38 -0400 (EDT) From: Jeff Roberson To: Terry Lambert In-Reply-To: <3E9ED311.1BC9610D@mindspring.com> Message-ID: <20030417131733.D76635-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: Patches for threads/scheduler abstraction. 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, 17 Apr 2003 17:19:46 -0000 Terry, you're frustrating me. So many of these comments are off the mark that I'm not going to address them. You continue to demonstrate that you don't know what you're talking about and yet you feel the need to tell me how it is. I know you're smart enough to get it but right now you're not getting it. Please, go write some code. On Thu, 17 Apr 2003, Terry Lambert wrote: > Jeff Roberson wrote: > > On Wed, 16 Apr 2003, Julian Elischer wrote: > > > For a start the simple one would be queueing threads on the run queues. > > > A system compiled with that scheduelr would have no KSEs anywhere > > > in the entire kernel. > > > The kse one would be queueing KSEs. I don't see how you can do this > > > with a shared file. > > > > You're missing the point. The scheduler shouldn't be tied to the > > threading implementation. > > I think you will lose CPU affinity and negaffinity, if you do this. > > I agree that the scheduler shouldn't know about threads, but it > has to know about scheduling entities, given that it's, well, a > scheduler, after all. > > Right now, there are too many locks taken in the scheduler path, > as it is, and I don't see how concurrency will be improved by > doing what you suggest. > > There is also no clustering support -- for migration of a process > from one node to another -- something that can't be done with a > scheduler that snoops shared memory, since the memory in question > isn't shared. > > > This way you will not duplicate code and you will keep the two tasks > > independant. Essentially the sched_*.c files decide system scope > > contention while the threading implementation determines the process scope > > contention which may include some concurrency limits imposed by KSE or > > some other structure. > > > > Do you see? This way we could get KSEs out of the entire kernel other > > than kern_kse.c and still support them with the sched_4bsd and sched_ule > > scheduler. Otherwise we're going to have a copy of each scheduler for > > each threading implementation and we wont be able to support two threading > > implementations simultaneously. > > I think this is premature optimization; you're complaining about > a multiplicy problem, but the most glaringly obvious multiplicy > problem in the scheduling context is the fact that the 4BSD and > ULE schedulers can't coexist in the same kernel. I know ULE is > your baby, but what is needed is a cleaner abstraction than you > are currently suggesting. > > I think if you go forward with a half-abstraction, which is going > to end up setting in concrete the non-coexistance of schedulers, > that it would be just as big a mistake as not doing the part that > you are talking about. > > If you want to rename the terminology, you should go ahead and > rename it. Mach calls the container abstraction for a process > for a scheduler a "task". If you want to call it that instead > of "KSE" (or "KSEGRP", which I personally don't like), then go > ahead -- BUT there needs to be some type of container, and it > needs to be common to all scheduler implementations, or a given > implementation won't be able to provide CPU affinity and negaffinity > for all the objects in the container class. > > > > > Anyhow, the following hack (totaly unoptimised.... notice the > > > > I think this describes the whole project so far. > > 8-) 8-). > > -- Terry >