Re: [RFC] [PATCH] Add memcpy32 function

Andreas Kleen
2005-12-28T17:50:43Z

Am Mi 28.12.2005 16:00 schrieb Bryan O'Sullivan <bos@pathscale.com>:

> All of our uses of memcpy_toio32 (which uses memcpy32 on x86_64) copy
> from kernel virtual addresses to MMIO space. There's no direct copying
> from userspace to MMIO space through the driver.
>
> However, we do let userspace code directly access portions of our
> chip.
> That code uses a routine that is exactly the same as memcpy32 to
> perform
> MMIO writes. That's where I think the confusion arose on the part of
> whoever responded to you.

Ok thanks. And do you have numbers that show that the assembly
function with rep ; movsl actually  improves performance over C?  I
guess the MMIO
is uncached or at best write combined and in both cases it usually
doesn't
matter if the CPU burns a few more cycles generating the writes or not
because everything is bus bound and every cycle you save
is just lost again on the next synchronization point with the hardware.

If the assembly is not really faster I would recommend you just use a
writel()
loop in the driver instead of adding this very special purpose function
everywhere.

-Andi