Re: Interesting pentium-memcpy results

Albert D. Cahalan (acahalan@cs.uml.edu)
Tue, 29 Jul 1997 11:54:22 -0400 (EDT)


> On Tue, 29 Jul 1997, Albert D. Cahalan wrote:
>
>> I think it shows that the memcpy size test is significant.
>> Perhaps the FPU is best used only when explicitly requested
>> for large operations. That would mean page clearing I guess.
>
> if you take a look at the patch, you would see the following code:
>
> +__memcpy_g (void *_to, const void *_from, __kernel_size_t _bytes)
> +{
> + if (bytes >= 1024) {

That is what I meant: the test itself adds overhead.
(the kernel became both slower and faster with the patch)
For small memcpys, that is a problem. It may be better to:

>> big_aligned_memcpy() and big_aligned_clear() perhaps?
>> For 512 bytes and up, optimized for each arch.

Then normal memcpy does not even test for size and
the FPU version does not test for alignment.
On other architectures, some other operation may be used.
In any case, the bulk memcpy does not check for alignment.