Re: PATCH [2.4.0test10]: Kiobuf#02, fault-in fix

Andrea Arcangeli
2000-11-03T22:27:21Z

On Thu, Nov 02, 2000 at 01:40:21PM +0000, Stephen C. Tweedie wrote:
> + if (!write || pte_write(*pte))

You should check pte is dirty, not only writeable.

> if (handle_mm_fault(current->mm, vma, ptr, datain) <= 0)
> goto out_unlock;
> spin_lock(&mm->page_table_lock);
> - map = follow_page(ptr);
> + map = follow_page(ptr, datain);

Here you should _first_ follow_page and do handle_mm_fault _only_ if the pte is
not ok. This way only during first pagein we'll walk the pagetables two times,
all the other times we'll walk pagetables only once just to check that the
mapping is still there.

Andrea