From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 11 17:36:47 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF4F716A41B for ; Sun, 11 Jun 2006 17:36:47 +0000 (UTC) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from correo.novusordo.net (cdjj.org [216.194.85.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 989A243D46 for ; Sun, 11 Jun 2006 17:36:47 +0000 (GMT) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from [192.168.2.100] (S010600c049bda6b5.ed.shawcable.net [68.149.198.157]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by correo.novusordo.net (Postfix) with ESMTP id 067F511523 for ; Sun, 11 Jun 2006 11:36:47 -0600 (MDT) Mime-Version: 1.0 (Apple Message framework v750) In-Reply-To: <473BD08B-7088-48E3-99AE-26DD572E95E6@novusordo.net> References: <1A2863A3-21D6-4F38-AB98-BAB605507095@novusordo.net> <200606111450.31041.pieter@degoeje.nl> <473BD08B-7088-48E3-99AE-26DD572E95E6@novusordo.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Chris Jones Date: Sun, 11 Jun 2006 11:36:45 -0600 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.750) Subject: Re: Jail-Aware Scheduling X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jun 2006 17:36:48 -0000 On 11-Jun-06, at 6:50 AM, Pieter de Goeje wrote: > For my CS study I picked up "Operating System Concepts" by > Silberschatz, > Galvin and Gagne. It has a fairly detailed description of the inner > workings > of a scheduler and the various algorithms involved, but no actual > implementation. Yep, we used the Dinosaur Book and I've still got it. I may even have Tanenbaum's OS book kicking around somewhere. >> - what're your thoughts on making the existing scheduler jail- >> aware as opposed to writing a sort of 'meta-scheduler' that would >> schedule between jails, and then delegate to a scheduler per jail >> (which could be very similar, if not identical, to the existing >> scheduler)? I've got some very preliminary thoughts on this, but I'd >> like to hear what you've got to say, as I'm aware that this is >> rather ... complex. > > I suppose by limiting the jail CPU usage you mean that jails > contending over > CPU each get their assigned share. But when the system is idle one > jail can > get all the CPU it wants. Exactly. Think of it as being like nice-on-steroids, but for a whole jail instead of a process. > Suppose you could detect wether a certain jail used too much CPU, > wouldn't it > be possible to lower the priorities of all the processes running > inside that > jail? And when the jail is "behind" on it's CPU quota, raise their > priorities > back to normal. > > I guess you could implement such a thing by a hook in the scheduler > which > examines the current CPU usage of each jail, say each second, and > takes > appropriate action accordingly. That's one way to do it using one big scheduler; on the other hand, the hierarchical scheduler approach could be as trivial as round- robin timeslicing on the "metascheduler" between the individual jails' schedulers (obviously, you'd really want at least to be able to do proportional timeslicing and probably to set the schedulers up to hand their timeslice back if they'd otherwise run the idle process). Joerg: thanks for the pointer to Luigi's scheduler; I'll check it out. Cheers, Chris