Re: {PATCH] Re: wasting time on page fault

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Wed Oct 11 2000 - 12:33:29 EST


On Tue, 10 Oct 2000, Jamie Lokier wrote:

>> > 1. Move the error_code block from divide_error to page_fault;
>> > this removes one jump from the page_fault path.
>>
>> It is not clear that it is worth it. You want to align error_code and
>> page_fault to 16 or 32 bytes bytes at least, and it would need to execute
>> some nops depending on the length for fallthrough
>> The jmp may be actually faster.
>...
>Regardless, I'd expect the page_fault path to occur far more often than
>any of the other fault/exception handlers that lead to error_code. So
>much more that not aligning error_code is probably the right thing to do.

To check this I wrote a kernel patch [*] to count the number of times
each fault source occurs. During a 2hr hacking session (boot, start X,
fvwm2, emacs, 2 xterms, unpacking tarballs, cvs checkouts and makes),
page_fault accounted for 99.8% of all faults. The remaining cases were
almost all device_not_available, which I believe is an artifact of lazy
FP state save/restore. I used the SML/NJ compiler to build one package,
and this triggered 15 overflow faults. No other faults occurred.

[*] In case anyone wants to try the patch on their own workloads, I put
it at http://www.csd.uu.se/~mikpe/linux/patch-2.4.0-test9-count-faults

So I agree with Jamie: the right thing to do is probably to just remove
the ALIGN before error_code and have page_fault fall through, with no
jumps or (pseudo-)nops.

Linus, do you agree? If so I'll send a patch against test10-pre.

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:18 EST