From owner-freebsd-arch@FreeBSD.ORG Thu Mar 27 11:51:08 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07EF137B401 for ; Thu, 27 Mar 2003 11:51:08 -0800 (PST) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BF6043F75 for ; Thu, 27 Mar 2003 11:51:07 -0800 (PST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h2RJovA89523; Thu, 27 Mar 2003 14:50:57 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Thu, 27 Mar 2003 14:50:56 -0500 (EST) From: Jeff Roberson To: Daniel Eischen In-Reply-To: Message-ID: <20030327143259.I64602-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-17.2 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: arch@freebsd.org cc: Scott Long Subject: Re: 1:1 threading. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2003 19:51:09 -0000 On Thu, 27 Mar 2003, Daniel Eischen wrote: > On Thu, 27 Mar 2003, Scott Long wrote: > > Once 5-STABLE happens, users of 5.x can no longer be guinea pigs for KSE > > development. By keeping the 1:1 and M:N API's separate, KSE can > > progress in 6-CURRENT until it is proven while still allowing MFC's to > > 5-STABLE to happen without too much pain. > > That's kind of silly; we have other ways to keep API/ABI > compatability and have used this for all other syscalls. > The KSE and thread mailboxes even have version numbers > in them. Which means they are likely to change. I do not want to develop on unstable APIs and unstable kernel code. kern_thr.c is 254 lines. I think we can handle a little duplication. I'm not sure why the objection is so strong. > > > Later on down the road when > > KSE matures, or when we decide that 1:1 should really just be a special > > case of M:N, we can look at addressing the above concerns and possibly > > MFC'ing the results back to 5-STABLE. But for now we need to allow for > > 5-STABLE to actually be usable and maintainable. > > The libthr implementation of 1:1 is not what most consider > 1:1 -- you don't get a separate quantum and priority for > each thread. As such, this library is really no different > than libkse. The only real difference is that the UTS > chooses the next thread to run instead of the kernel. > If you're going to add a bunch of code to both userland > (in libthr) and the kernel just to get a working threading > library, it seems much easier to just fix libkse so that > it works for the single KSE/KSEG case. It didn't seem much easier to me. This whole argument about kseg/kse/thread vs kse/thread can be solved very easily by allocating a ksegrp in kern_thr.c I estimate that would add another 10 lines of code. The ksegrp argument is questionable anyway. In both ULE and 4bds each KSE gets its own quantum. The KSEGRP holds the static priority and the dynamic user priority which is calculated based on the behavior of the whole process. This causes all threads in the process to be penalized for using cpu at the same rate as a single threaded process using an equivalent amount of cpu would be. The effects are less because each thread/kse is given as big of a quantum as each full process would. I'm not sure if this is a bug or a feature. In my opnion the ksegrp is not totally hashed out. I think you may forget that I have done a fair amount of work on schedulers in freebsd and I do understand the ramification of the decision that I made. I do not think this at all important to have correct prior to having real users using real threads. Cheers, Jeff