Messages in this thread | | | Date | Mon, 12 Oct 2009 16:13:04 -0400 | From | Neil Horman <> | Subject | Re: [PATCH 0/3] extend get/setrlimit to support setting rlimits external to a process (v6) |
| |
Sign, marcin just pointed out that I'm an idiot (thanks :) ). I posted a version of this patch that was incorrect. Heres the right one, with the all the fixes he requested
Neil
Summary:
Its been requested often that we have the ability to read and modify process rlimit values from contexts external to the owning process. Ideally this allows sysadmins to adjust rlimits on long running processes wihout the need to stop and restart those processes, which incurs undesireable downtime. This patch enables that functionality, It does so in two places. First it enables process limit setting by writing to the /proc/pid/limits file a string in the format: <limit> <current limit> <max limit> > /proc/<pid>/limits where limit is one of [as,core,cpu,data,fsize,locks,memlock,msgqueue,nice,nofile,nproc,rss,rtprio,rttime]
Secondly it allows for programatic setting of these limits via 2 new syscalls, getprlimit, and setprlimit, which act in an identical fashion to getrlimit and setrlimit respectively, except that they except a process id as an extra argument, to specify the process id of the rlimit values that you wish to read/write
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
| |