Re: [PATCH]: proc: export a processes resource limits via proc/<pid>

From: Valdis . Kletnieks
Date: Mon Aug 13 2007 - 13:08:53 EST


On Mon, 13 Aug 2007 10:00:44 EDT, Neil Horman said:
> Hey there-
> 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.

> /************************************************************************/
> /* Here the fs part begins */
> /************************************************************************/
> @@ -2017,6 +2080,7 @@ static const struct pid_entry tgid_base_stuff[] = {
> INF("environ", S_IRUSR, pid_environ),
> INF("auxv", S_IRUSR, pid_auxv),
> INF("status", S_IRUGO, pid_status),
> + INF("limits", S_IRUGO, pid_limits),

Any takers for S_IRUSR instead? Either that, or lay out the use case for
making it S_IRUGO. (I'm OK on it being world-visible *if* there's a good
and sane reason for it)

> #ifdef CONFIG_SCHED_DEBUG
> REG("sched", S_IRUGO|S_IWUSR, pid_sched),
> #endif
> @@ -2310,6 +2374,7 @@ static const struct pid_entry tid_base_stuff[] = {
> INF("environ", S_IRUSR, pid_environ),
> INF("auxv", S_IRUSR, pid_auxv),
> INF("status", S_IRUGO, pid_status),
> + INF("limits", S_IRUGO, pid_limits),

Here too.

Attachment: pgp00000.pgp
Description: PGP signature