Re: fork: out of memory

Mike Jagdis (mike@roan.co.uk)
Wed, 26 Nov 1997 10:52:32 +0000 (GMT/BST)


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,

Paging *is* on in the kernel. It isn't so much a case of the kernel
seeing contiguous memory as of devices seeing *physically*
contiguous memory. There are a few case where we know nothing
will want to do DMA to a multi-page region and in such cases we
could use vmalloc (which already exists) but that has a relatively
heavy set up / tear down penalty so better solutions that don't
use vmalloc are prefered. Vmalloc doesn't help the problem that
much anyway - most of the big page requests are for things like
floppy buffers and sound buffers which have to be physically
contiguous for DMA.

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

Plus you have the overhead of changing references, plus you have
cache penalty overheads if you move a hot page. But if you manage
the page pool well you can make good decisions and use reclaim
if necessary quite effectively. As long as you don't let dirty
pages build up even large atomic requests should be satisfiable.

Mike

-- 
.----------------------------------------------------------------------.
|  Mike Jagdis                  |  Internet:  mailto:mike@roan.co.uk   |
|  Roan Technology Ltd.         |                                      |
|  54A Peach Street, Wokingham  |  Telephone:  +44 118 989 0403        |
|  RG40 1XG, ENGLAND            |  Fax:        +44 118 989 1195        |
`----------------------------------------------------------------------'