Re: fork: out of memory

Mike Jagdis (mike@roan.co.uk)
Wed, 26 Nov 1997 15:34:37 +0000 (GMT/BST)


On Wed, 26 Nov 1997, Jan Echternach wrote:

> But if we need a DMA buffer that is physically contiguous can't we
> just move non-DMA pages around and adjust the page tables such that
> logical addresses stay the same?

Assuming you know which pages are only accessed using logical
addresses. We currently have no way of knowing that a page was
allocated *because* it was DMA-able.

Besides which remapping implies that you would have to relocate
the page in kernel virtual space (since multi-page allocations
want to be at least contiguous in kernel vm). Therefore the kernel
mapping has to use the same paging as user mappings (i.e. no 4MB page
optimizations). You don't want to be changing kernel page tables
too much either. A good solution just isn't as simple as changing
a few mappings :-(.

> It should be possible to change page tables and let all other references
> stay the same.

I meant, "references by ptes". If you move a page that is shared
many times (such as a libc page) you will change a fair few ptes,
flush a load of tlb entries and bounce quite a few L1/L2 cache
entries. So remapping has quite a cost and should only be a
late resort solution (last resort would be to just junk the pages,
assuming clean, and page them back in when needed).

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        |
`----------------------------------------------------------------------'