lkml.org 
[lkml]   [2007]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH]: proc: export a processes resource limits via proc/<pid>
From
Date
On Thu, 16 Aug 2007 08:35:38 EDT, Neil Horman said:
> Hey again-
> Andrew requested that I repost this cleanly, after running the patch
> through checkpatch. As requested here it is with the changelog.
>
> Currently, there exists no method for a process to query the resource
> limits of another process. They can be inferred via some mechanisms but they
> cannot be explicitly determined. Given that this information can be usefull
to
> know during the debugging of an application, I've written this patch which
> exports all of a processes limits via /proc/<pid>/limits.
>
> Tested successfully by myself on x86 on top of 2.6.23-rc2-mm1.

I had only one comment the first time around, and Neil addressed it.

I've also tested on x86_64 23-rc2-mm1, and it works here too. I saw where this
uses units of 'bytes' while the shell 'ulimit' uses 1024-byte units in some
places, but (a) this lists the units and (b) it's consistent with setrlimit().
Testing with values >4G show it's 64-bit clean as well.

One question: Is the units milliseconds, or seconds here:

+ [RLIMIT_CPU] = {"Max cpu time", "ms"},

Other than that, feel free to stick either/both of these on:

Reviewed-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Tested-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-08-17 10:13    [W:0.089 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site