Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2006 11:36:45 -0600
From:      Chris Jones <cdjones-freebsd-hackers@novusordo.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Jail-Aware Scheduling
Message-ID:  <AC0A1861-84DC-42E6-93FF-4FC14B6AC283@novusordo.net>
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>

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

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC0A1861-84DC-42E6-93FF-4FC14B6AC283>