Re: MMX bzero of a page...

Benjamin C.R. LaHaise (blah@kvack.org)
Wed, 11 Mar 1998 15:44:57 -0500 (EST)


On Wed, 11 Mar 1998, Perry Harrington wrote:
.....
> The snippet I posted was specifically designed for a bulk page clearing
> purpose. I do realize the expense of MMX, with FPU regs and all. In this
> case, MMX could make clearing pages trivial. I haven't found an instruction
> list with clock tick counts yet. I could just implement this and use rdtsc,
> but I don't know if my assembler supports MMX instructions, anyone???

Also, you don't even need to use MMX - the same trick is accomplished
using the FPU registers. Note that I just had a look though the FPU
memcpy patch the other day, and it's not entirely correct, especially the
copy_(to|from)_user stuff. Some improvements that need to be made to the
patch before it's integrated are:

a) when saving FPU state, it should be saved to task that it
belongs to. (see the scheduler lazy-FPU saving tricks)
b) only bother saving the FPU state if the last user of the FPU
was a user process
c) perhaps add a fallback mechanism for machines that don't have
an FPU, or where the FPU is slow? That way the one-kernel-fits-all people
can still get the performance benefit.

Note that it might be worthwhile to move the memcpy code out of the inline
stream and instead use a quick call with register parameters (akin to some
of the funky spinlock code).

-ben

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu