Re: fork: out of memory

Rik van Riel (H.H.vanRiel@fys.ruu.nl)
Tue, 25 Nov 1997 19:48:33 +0100 (MET)


On Tue, 25 Nov 1997, Richard Jones wrote:

> I must be missing a big point here ... why is it not
> possible to either (a) turn on paging in the kernel
> so that non-contiguous pages can be easily made to look
> contiguous to kernel code

Often the chunks are allocated by device drivers who pass
on the address to some busmastering card... You wouldn't
want your scsi controller to overwrite programs in memory,
would you?

> , or (b) when you can't find
> 8 contiguous pages, pick the first free page and swap
> the data in the next 7 adjacent pages with other free
> pages in memory. Method (b) could construct any number of
> contiguous free pages atomically with the only penalty
> being some chunky memcpy's ...

Those 7 other pages are referenced from loads of other
places in the kernel. To copy all of them you'd need
to find (and update) all of'em.
We are working on it (well, somewhat) and hope to find
a way for finding the references in an efficient way...
For now, we just swap out so many pages that we have
several large chunks (of free mem) available, it seems
to work rather well.

(this feature can be found in my vhand patch, you can get
it from http://www.fys.ruu.nl/~riel/)

grtz,

Rik.

----------
Send Linux memory-management wishes to me: I'm currently looking
for something to hack...