lkml.org 
[lkml]   [2010]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git pull] pull request for writable limits for 2.6.34-rc0


On Sun, 21 Mar 2010, Alexey Dobriyan wrote:
>
> It's a perfect opportunity to introduce getrlimit64(2), setrlimit64(2)
> _without_ involving /proc, without all bugs in setrlimit(2), without
> compat code, with all resources equal across arches, and, optionally,
> with infinity setting clearly separate from value (useful for C/R).

Yeah, the infinity setting should be cleaned up. I also wonder if we
should clean up the odd file limit rules, and make them all be about
bytes. Correct me if I'm wrong, but don't we do that whole file size thing
in kilobytes right now?

I do also agree that maybe we could/should skip the whole "writable /proc"
thing.

So introducing it as just two system calls:

int getprlimit64(pid, limit, struct rlimit64 *);
int setprlimit64(pid, limit, const struct rlimit64 *);

and having perhaps something like 'pid=0 means current' would look a lot
prettier to me.

Or even just _one_ system call that takes two pointers, and can do an
atomic replace-and-return-the-old-value, like 'sigaction()' does, ie
something like

int prlimit64(pid, limit, const struct rlimit64 *new, struct rlimit64 *old);

wouldn't that be a nice generic interface?

(Somebody should really check me on the whole "limit in kilobytes" thing -
I may be _totally_ off there. I am too lazy to check the actual source
code)

Linus


\
 
 \ /
  Last update: 2010-03-21 19:45    [W:0.282 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site