Re: Overcomittable memory

From: James Sutherland (jas88@cam.ac.uk)
Date: Fri Mar 17 2000 - 03:32:39 EST


On Fri, 17 Mar 2000, Alan Cox wrote:

> > parent process has allocated. If you want to honour this without
> > overcommit, you must disable COW - otherwise you've overcommitted your
> > memory.
>
> You need to account as if you were disabling COW and also assuming any
> shared object might cease to be so, but you dont have to actually
> disable it. Your apache will run as fast as before, you just need a gig of
> swap 'in case'.

i.e. my WWW server, with 100 20Mb Apache processes, needs 2Gb of swap
dedicated 'just in case'. Not ideal, IMO...

> You can also reduce the footprint materially by allowing COW of read only
> pages and charging for them at the point you use ptrace or mprotect().
>
> In truth you are accounting virtual address space for the entire system, and
> tht is btw how to implement it. Bill at the point you create/delete or
> modify a VMA (including the split/merge cases).
>
> The special case is ptrace, which is so weird anyway that adding cases
> to it isnt that hard.
>
> You also need to pick a number to count as 'potentially kernel eaten' which
> I guess for paranoia sake you'd pick ram size. This means you need to turn it
> on after boot so you can actually set up swap to run anything.
>
> But you can do it, you need to account in pages to avoid overrunning 32bit
> count limits, you need to allow a lot of swap and you need to allow for
> kernel ram. Big disks are cheap so if you think there is a need then
> look at the VMA code in mm/*.c and hack.

I'm not at all sure there is a need for this - it will just waste a large
amount of swap space in most cases, and lead to premature "out of memory"
conditions - large amounts of usable swap are being reserved 'just in
case', which we could otherwise allocate.

Proper per-user resource limits, OTOH, WOULD be a good thing IMO. They
wouldn't completely solve the problem, but should certainly make it much
more difficult for Joe Random Luser to "malloc-bomb" the box - he'd just
eat up his quota instead.

James.

-
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/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:23 EST