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

Andrea Arcangeli
2000-11-07T13:37:07Z

On Tue, Nov 07, 2000 at 11:57:44AM +0000, Stephen C. Tweedie wrote:
> Is this a 2.5 cleanup or do you want things rearranged in the 2.4
> bugfix too?

I'm sorry but I've not understood exactly the suggestion (the shown pseudocode
will stack overflow btw).

I don't think returning the page gives advantages. The point here is the
locking. We need to do this atomically (with the spinlock acquired):

spin_lock(&mm->page_table_lock);
check the pte is ok
get_page(page);
spin_unlock(&mm->page_table_lock);

The above is not necessary for any real page fault. That's needed only by
map_user_kiobuf that must atomically (atomically w.r.t. swap_out) pin the
physical page. IMHO it would be silly to add the locking and a get_page() (plus
a put_page after the page is returned to the page fault arch code) inside the
common page fault handler just to skip a walk of the pagetables for the case
where rawio is accessing a not correctly mapped page.

Andrea