Re: swapout selection change in pre1

Roman Zippel
2001-01-18T15:38:54Z

Hi,

Rik van Riel wrote:

> > Reverse mapping is basically not simple at all. For each page table entry,
> > you need a
> >
> > struct reverse_map {
> > /* actual pte pointer is implied by location,
> > if you implement this cleverly, but still
> > needed, of course */
> > struct reverse_map *prev, *next;
> > struct vm_struct *vma;
> > };
>
> Actually, you need only 2 pointers per page.
>
> struct reverse_map {
> pte_t * pte;
> struct reverse_map * next;
> };

To keep memory usage low and to still be reasonably fast, we could
restrict the size of a vma to two mmu levels and cache a pointer to the
pmd table in the vma, so you have less to lookup in the page table. It
would also speed up normal mapping/unmapping of entries for
architectures with more than 2 mmu levels. Generic mm code had mostly
only to deal with two mmu levels and e.g could call "pmd =
pmd_alloc_vma(vma, address);" instead of "pgd = pgd_offset(mm, address);
pmd = pmd_alloc(pgd, address);". No idea if this is fast enough for
balancing, but it would simplify other parts. :-)

bye, Roman