Re: RLIMIT virtual mem per user?

Chris Wedgwood (chris@cybernet.co.nz)
Mon, 19 Oct 1998 18:12:10 +1300


On Sun, Oct 18, 1998 at 09:13:43PM +0200, forcer wrote:

> I heard many complains lately about the lack of a limit for memory
> per user, similar to RLIMIT_NPROC.

> I really wonder why this isn't implemented yet.

It's a 2.3.x thing. AlanC has already had a crack at this of sorts
(the beancounter stuff).

> Forgive any possible misconceptions, sadly i'm not a kernel-hacker,
> but i don't see any big problems there:

> - We add a field `cur_mem' to the user which holds the currently assigned
> memory for that user

What if that memory is a shared RO page, mmap from a file owner by
someone else?

> - On every call for new memory (mmap, sbrk, any more?) we check
> this field plus the requested amount against the limit, and
> return an error if it's over the limit.

We also need to charge for memory outside of this. Memory used in
sockets and pipes for example.

-cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/