mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Matt Mackall <mpm@selenic.com>
Cc: Andy Isaacson <adi@hexapodia.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Valdis.Kletnieks@vt.edu, linux-kernel@vger.kernel.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH]: proc: export a processes resource limits via proc/<pid>
Date: Thu, 23 Aug 2007 06:53:14 -0400	[thread overview]
Message-ID: <20070823105314.GA21034@hmsreliant.think-freely.org> (raw)
In-Reply-To: <20070823024036.GP11166@waste.org>

On Wed, Aug 22, 2007 at 09:40:37PM -0500, Matt Mackall wrote:
> On Tue, Aug 21, 2007 at 11:56:11AM -0700, Andy Isaacson wrote:
> > On Fri, Aug 17, 2007 at 12:45:47PM -0700, Andrew Morton wrote:
> > > On Fri, 17 Aug 2007 06:59:18 -0400
> > > Neil Horman <nhorman@tuxdriver.com> wrote:
> > > > 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.
> > > 
> > > I'm struggling with this a bit.  Sure, it _might_ be handy on some
> > > occasions to be able to get at this information.  But I've never seen
> > > anyone ask for it before, and it _is_ determinable by other means, if only
> > > strace.
> > 
> > I've wanted this information on multiple occasions in the past and was
> > mystified that there was no way to determine it.  And no, I don't feel
> > that strace is an answer -- given a running process, how do I use strace
> > to find out what its current ulimits are?
> 
> You stop it and force it to execute rlimit(2) in its context, of
> course! What could be simpler? 
> 
I would think reading a file in /proc would be simpler :), especially if you're
in a position where attaching to the process through ptrace isnt feasible. For
instance, if you were an application running as the result of a core dump when
/proc/sys/kernel/core_pattern were a pipe, preforming your operation wouldn't be
particularly possible.  Likewise, if your a sysadmin and you want to check what
your processes limits were, you could follow your method, but I would think you
would much rather avoid needing to send several ptrace commands to your
commands, interrupting its work if you didn't have to.

> The reason we never see questions about this is because relatively few
> people are using limits. Instead we see weekly questions about fork
> bombs.
> 
But we do see questions about this. I've had a few requests, and at least two
more people have popped up on this thread supporting it.

Regards
Neil

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *nhorman@tuxdriver.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/

      reply	other threads:[~2007-08-23 10:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13 14:00 Neil Horman
2007-08-13 15:47 ` Arjan van de Ven
2007-08-13 16:47 ` Valdis.Kletnieks
2007-08-13 17:26   ` Neil Horman
2007-08-13 19:25 ` Ingo Oeser
2007-08-13 20:11   ` Neil Horman
2007-08-13 21:04     ` Alexey Dobriyan
2007-08-13 23:58       ` Neil Horman
2007-08-16 12:35 ` Neil Horman
2007-08-17  8:09   ` Valdis.Kletnieks
2007-08-17 10:59     ` Neil Horman
2007-08-17 19:45       ` Andrew Morton
2007-08-17 20:20         ` Valdis.Kletnieks
2007-08-17 21:00         ` Neil Horman
2007-08-21 18:56         ` Andy Isaacson
2007-08-23  2:40           ` Matt Mackall
2007-08-23 10:53             ` Neil Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070823105314.GA21034@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=adi@hexapodia.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®