From owner-freebsd-arch@FreeBSD.ORG Thu Mar 27 22:29:02 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 B72B737B401 for ; Thu, 27 Mar 2003 22:29:02 -0800 (PST) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id E16B543F85 for ; Thu, 27 Mar 2003 22:29:00 -0800 (PST) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h2S6SsmF022454; Fri, 28 Mar 2003 09:28:54 +0300 (MSK) Date: Fri, 28 Mar 2003 09:28:54 +0300 (MSK) From: Igor Sysoev X-Sender: is@is To: freebsd-arch@freebsd.org In-Reply-To: <20030327143259.I64602-100000@mail.chesapeake.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-20.6 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,USER_AGENT_PINE autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) 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: Fri, 28 Mar 2003 06:29:03 -0000 On Thu, 27 Mar 2003, Jeff Roberson wrote: >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. Why should multi-threaded process get more CPU time then single threaded if they both have the same base priority ? CPU time should be given based on a process priority not a number of its threads. >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. It's not a bug or a feature. It's the right thing. >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. As I understand KSEGRP was designed with M:N model in mind. If you have M threads mapped to N KSEs then all these KSEs should have the same priority. The second KSEGRP capability is to limit a number of KSEs to a number of CPUs. It's usefull for M:N model because KSE is almost never (I believe) blocked and always ready to run (if not parked). For 1:1 model KSEGRP is not theoreticaly needed because you can set priority (theoreticaly) directly in KSE and you do not need to limit a number of KSEs to a number of CPUs. If the thread blocks then its KSE blocks too. But I think for design completeness you should use KSEGRP to store KSE's priority in 1:1 model. Igor Syseov http://sysoev.ru/en/