[PATCH] Jail Memory Limits

Chris Jones cdjones-freebsd-hackers at novusordo.net
Tue Aug 1 20:16:50 UTC 2006


Hi, folks --- I have a beta patch to add memory limits (on the basis  
of RSS) to jails, and would love to get some people to test it out.   
The patch files (below) are against RELENG_6 from earlier this  
morning, but should work against anything recent.  They should be  
applied under /usr/src.

This creates a kernel process for each jail to intermittently 1)  
check whether the jail's overcommitted on RSS and 2) if so, to  
partially page out the processes in the same way that's used for when  
the system's short on memory.  This permits short periods of over- 
use, with a tendency back to the limit.  (Aside: this is the same way  
Solaris handles it.)

To test, use the new '-m MEM_LIMIT_IN_MB' flag to jail to set the  
memory limit for the jail; I've also included a trivial program which  
consumes and holds memory which can be run inside the jail.  Take a  
look on the console for the debugging information, which is rather  
verbose at the moment.

I'm expecting patches for jail scheduling to be coming down the pipe  
soon.

Cheers,

Chris



-------------- next part --------------
A non-text attachment was scrubbed...
Name: kern.patch
Type: application/octet-stream
Size: 6894 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060801/e0991a13/kern.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sys.patch
Type: application/octet-stream
Size: 2506 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060801/e0991a13/sys.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usr.sbin.patch
Type: application/octet-stream
Size: 2060 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060801/e0991a13/usr.sbin.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: useMemory.c
Type: application/octet-stream
Size: 1348 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060801/e0991a13/useMemory.obj


More information about the freebsd-hackers mailing list