Re: Resource limits interface proposal [was: pull request for writable limits]

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Wednesday, May 5, 2010 - 8:08 am

On Wed, 5 May 2010, Jiri Slaby wrote:

Yes, this sounds much better to me.


Ok, I'm not entirely sure we need to care specially about INFINITY, 
_especially_ since INF is really rather big in 64 bits. So to some degree, 
making things 64-bit is _less_ likely to make INFINITIES a problem.

It's also impossible to convert back and forth reliably unless you were to 
add this bit to the internal rlimit structure too. It sounds like a bad 
design to have

	prlimit64(-1, limit, &new, NULL);
	prlimit64(-1, limit, NULL, &old);

result in "old" containing something different than "new".

Of course, if there are 32-bit/64-bit issues, the above can _never_ give 
the same results for >= (1<<32) values, but that's a somewhat separate 
issue, and is directly tied to the word-size, not some new internal flag.


I'd almost prefer to just turn them into RLIMIT_MAX. If somebody asks for 
a really huge limit that is bigger than the max we already have, doesn't 
RLIMIT_MAX sound like the right thing?


I think long-term we might want to do this, but not as a first stage. And 
if the 'infinity' flag makes sense, _and_ we decide that long-term we want 
to do this, then I'm not objecting to adding it now.


What does the glibc 'struct rlimit64' look like? It's the structure name 
that matters, since the system call name would presumably be 'prlimit64()' 
due to the pid thing.

And if the glibc rlimit64 matches what we would use, I think we can decide 
to just re-use it.

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PULL] pull request for limits FIXES for 2.6.33-rc, Jiri Slaby, (Mon Jan 4, 3:47 am)
Re: Resource limits interface proposal [was: pull request ..., Linus Torvalds, (Wed May 5, 8:08 am)
[PATCH 04/11] rlimits: split sys_setrlimit, Jiri Slaby, (Fri May 7, 1:55 am)
[PATCH 07/11] rlimits: add rlimit64 structure, Jiri Slaby, (Fri May 7, 1:55 am)
[PATCH 10/11] rlimits: implement prlimit64 syscall, Jiri Slaby, (Fri May 7, 1:55 am)