Skip to contentSkip to conversation

Large memory system

DISCUSSION Manfred Spraul 2 participants 2 messages Feb 10, 1999 – Feb 11, 1999 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

The primary reason for adding more memory is for process anonymous pages, not for cache, so this is really of limited value on its own.

This was not intended as a solution, but as a new idea:
- the memory > 1 GB is allocated one page at a time.
- some 'struct page' fields are useless for high memory.
- if someone who is not prepared to handle high memory finds such a page, the computer will crash anyway.
- high memory needs bounce buffers, so a special if(highmem()) is required. ---> no need to use mem_map, add an independant array for high_mem.

The advantage is that you can add new fields to such an array (e.g. true LRU for a cache), without causing problems in the remaining kernel.

If you restrict the remaining memory to unshared pages (i.e. no COW), then the implementation should be really simple:

* all page-in's go to normal memory (i.e. < 1 GB) (swap cache compatible)
* if try_to_swap_out() want's to discard a page, it is first moved to high memory.
(this break's any COW links.)
* if <shrink_highmem> decides that a page should be discarded, then the page is removed from the vma, a bounce buffer is created, written out & added to the swap cache.

I'm sure that this could be extended to COW pages, but I haven't yet understood the COW implementation :=)

Regards,
Manfred

--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

#1 lore raw

Hi,

Quoted 7 lines · Manfred Spraul

This was not intended as a solution, but as a new idea:
- the memory > 1 GB is allocated one page at a time.
- some 'struct page' fields are useless for high memory.
- if someone who is not prepared to handle high memory finds such a page, the computer will crash anyway.
- high memory needs bounce buffers, so a special if(highmem()) is required.

All of this is already in the design.

Quoted 1 line

---> no need to use mem_map, add an independant array for high_mem.

No, it makes no sense at all to do this, because you'd have to implement two separate page caches if you wanted both low-mem and high-mem cached pages. It makes far, far more sense to simply expand mem_map.

Quoted 2 lines

The advantage is that you can add new fields to such an array (e.g. true LRU for a cache), without causing problems in the remaining kernel.

That's really not a problem. As long as we never hand out a high-mem page to the kernel unless the kernel explicitly asks for one (for anonymous pages or page cache), the kernel can never get so confused anyway.

Quoted 2 lines

If you restrict the remaining memory to unshared pages (i.e. no COW), then the implementation should be really simple:

There is no reason to make this restriction, COW is dead easy.

--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/