To: linux-kernel@vger.rutgers.edu Subject: [PATCH] per-process RSS limits (was: Re: Process Aggregates: module based support for jobs) From: Peter Chubb <peterc@aurema.com> Date: 23 Jun 2000 08:54:24 +1000 Hi Everyone, As a first step toward RSS limits/guarantees, we've been working on making the setrlimit(RLIMIT_RSS,...) call work. The 12k patch at ftp://ftp-au.aurema.com/private/aurpjc31/linux-2216-rsslimit.diff.bz2 tracks integral and maximum RSS and makes them available to the getrusage() and wait4() system calls (so /usr/bin/time -v reports something meaningful), and adds three new CONFIG_EXPERIMENTAL options to an otherwise stock Linux 2.2.16. These are: CONFIG_PROC_RSS Adds to /proc a file in each process's directory /proc/<pid>/rss which allows control of RSS limits, and monitoring of minor and major page fault rates. We use this primarily to test the other two options: CONFIG_RSS_HARDLIMIT causes any process that is over its limit to release a page every time it tries to grab a page. CONFIG_RSS_SOFTLIMIT creates a new daemon, krssd, that every second scans all address spaces looking for ones over their limit, and attempts to shrink each until under limit again. It shouldn't be too hard to port the patch to 2.4.0-xxx or 2.5 when it gets going. When no processes are over limit, there's no obvious difference in overhead -- it's down in the noise (on my machines, there's more difference in successive runs of make -j4 clean; make -j4 bzImage on the same kernel than there is between the average of ten runs with and without the patch) Share and Enjoy! -- Dr Peter Chubb, Vice-President, Research Aurema Pty Ltd, P.O. Box 305, Strawberry Hills, NSW 2012, AUSTRALIA Phone: +61 2 9698 2322; Fax: +61 2 9699 9174; peterc@aurema.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/