Re: A true story of a crash.

Stephen C. Tweedie (sct@redhat.com)
Mon, 24 Aug 1998 17:25:57 +0100


Hi,

On Sun, 16 Aug 1998 19:04:08 +0100 (BST), alan@lxorguk.ukuu.org.uk (Alan
Cox) said:

> The accounting requirements are pretty simple. There must be some space
> in the system which is capable of holding every data page that may be
> created, and ptrace/mprotect (the two calls that can cause COW of pages
> previously not copyable) must be able to fail with out of memory errors.

It's worse than that: there must be *swap* space capable of holding
every reference to every private writable page. You have to be able to
fill up the whole of physical memory with nonpageable data and still be
able to cope if you want to do it right.

There are two reasons for this: one is the fact that we can never fully
know in advance how much nonpageable memory the kernel will want, so we
have to be conservative. The other is the swap cache: during swap IO,
and afterwards for performance reasons, we want to be able to hang on to
the on-disk copy of a swapped in page in case the page gets swapped out
again without being modified. Because of that, we cannot account
physical memory and swap as both contributing to the available swap
space. Only if there is enough swap space for every private page can we
guarantee that this will work.

--Stephen

-
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.altern.org/andrebalsa/doc/lkml-faq.html