Re: flush_tlb_page in unuse_pte

David S. Miller (davem@jenolan.rutgers.edu)
Tue, 26 Aug 1997 20:23:57 -0400


Really, the whole swapping mechanism is full of sick races.

They all eminate from the fact that the swapping out of vma's within
an mm occur with no locking, and thus no guarentees of safety, of that
address space.

The real fix is the make swapping grab the mmap semaphore, or at least
do _something_ which prevents:

kswapd process

choose vma
pick page to swap out
rw_swap_page()
sleep
munmap(vma);

flush_tlb_page(vma, page);
OOPS vma no longer exists!

The current code makes no effort to try and prevent this situation
from occuring. Fix this, and you'll fix a lot of races inherent in
the current swapping code.

Later,
David "Sparc" Miller
davem@caip.rutgers.edu