Re: [PATCH] swap_state.c thinko

Linus Torvalds
2001-04-09T20:32:41Z

On Mon, 9 Apr 2001, Alan Cox wrote:
>
> Given that strict address space management is not that hard would you
> accept patches to allow optional non-overcommit in 2.5

I really doubt anybody wants to use a truly non-overcommit system.

It would basically imply counting every single vma that is privately
writable, and assuming it becomes totally non-shared.

Try this on your system as root:

cat /proc/*/maps | grep ' .w.p '

and see how much memory that is.

On my machine, running X, that's about 53M with just a few windows open if
I did my script right. It grew to 159M when starting StarOffice.

(I'm oldfashioned, and not a perl person, so:

cat /proc/*/maps |
grep 'w.p ' |
cut -d' ' -f1 |
tr '-' ' ' |
while read i j; do export k=$(($k + 0x$j-0x$i)) ; echo $k; done

I haven't verified that it gets it right. And that's not counting the
really hardwired pages at all, only th epages that might be pageable).

It would disallow a lot of stuff that actually _does_ work in practice.

But maybe some people do want this. I agree that it shouldn't be
fundamentally hard to do accounting at the vma level.

Linus