Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2006 14:50:30 +0200
From:      Pieter de Goeje <pieter@degoeje.nl>
To:        freebsd-hackers@freebsd.org
Cc:        Chris Jones <cdjones-freebsd-hackers@novusordo.net>
Subject:   Re: Jail-Aware Scheduling
Message-ID:  <200606111450.31041.pieter@degoeje.nl>
In-Reply-To: <1A2863A3-21D6-4F38-AB98-BAB605507095@novusordo.net>
References:  <1A2863A3-21D6-4F38-AB98-BAB605507095@novusordo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Chris,

On Sunday 11 June 2006 07:51, Chris Jones wrote:
> Hi, folks --- as some of you might know, FreeBSD has a Summer of Code
> project to bring resource limits to jails, and one part of that is to
> permit an administrator to put limits on a jail's CPU usage.  That's
> where I come in: I'm the guy doing the project, and I've been
> spending the last two weeks coming up to speed on scheduling and the
> like.
>
> What I'd like from freebsd-hackers is the following:
>
>    - are there any good references on scheduling that you know of
> which I should read?  I've already got Design & Implementation of
> FreeBSD and the Petrou / Milford / Gibson and Waldspurger / Weihl
> papers on lottery scheduling.

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.

>
>    - 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.

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.

Regards,

Pieter



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606111450.31041.pieter>