Re: [PATCH 2.6.13-rc6 1/2] New Syscall: get rlimits of any process (update)

From: Ulrich Drepper
Date: Tue Aug 23 2005 - 00:52:47 EST


On 8/18/05, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> Perhaps those application authors should provide a management interface
> to do so within the soft limit range at least. Its not clear to me that
> growing the fd array on a process is even safe. Some programs do size
> arrays at startup after querying the rlimit data.

That's very true. Using such a remote-rlimit syscall would break all
kinds of code. It's a basic assumption from Unix/POSIX that the
limits remain constant. And as Alan hinted at: this is why there are
soft and hard limits. If tey are set to the same value you obviously
don't get anything. But this is the application programmer's fault.
An application which is aware of resources and tries to limit them
should set the soft limits to a reasonable low value and the hard
limit to the absolute maximum (probably the system's maximum). Then
you can have remote procedure calls into the application to adjust the
soft limits. Having to change the hard limit means the capacity
planning for the app is completely wrong. A restart is certainly
acceptable in that case since it should really never happen.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/