Re: [patch] do_no_pfn handler

From: Nick Piggin
Date: Wed Apr 05 2006 - 05:10:31 EST


Jes Sorensen wrote:
Hi,

Ingo Oeser suggested reorganizing the hangle_pte_fault code in a way
that simplifies the code deciding which fault handler to call. It
makes the call to ->nopfn and ->nopage a lot clearer.


Probably doesn't make much difference, but I'd rather do the nopage
check first, as that will obviously be the most common.

It doesn't address Nick's suggestion as whether to recheck for someone
else faulting it as I didn't see a consensus on that yet.


I first thought this might be a good idea because some archs have a
pretty heavy-weight set_pte_at (eg. powerpc, which is even heavier if
it is to replace an existing entry). This is not going to be very
common, but there have been cases where multiple threads all try to
fault in a particular page, which has caused performance problems.

Other than that, you never know what a nopfn handler will want to do,
so I think it is better to be consistent with other faults. Shouldn't
need much more than a `if (pte_none()) { /* do it */ }`.

Updated patch attached.

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/