[RFC v2] non-temporal memcpy

Morten Brørup mb at smartsharesystems.com
Thu Jul 28 11:00:28 CEST 2022


> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Wednesday, 27 July 2022 21.12
[RFC v2] non-temporal memcpy
> 
> On Wed, 27 Jul 2022 20:49:59 +0200
> Morten Brørup <mb at smartsharesystems.com> wrote:
> 
> > I'm considering rte_memcpy_nt() a performance optimized variant of
> memcpy(), where the performance gain is less cache pollution. Thus,
> silent fallback to memcpy() should suffice.
> 
> 
> Have you looked at existing Glibc code? last time I checked it was
> already doing
> non-temporal instructions on several architectures.

Good idea!

I found the glibc implementation of memcpy() [1], and it only uses non-temporal store, not non-temporal load; and only for big lengths.

BTW, this also reveals that memcpy() sometimes behaves differently than rte_memcpy(), which never uses non-temporal store.

[1] https://elixir.bootlin.com/glibc/latest/source/sysdeps/x86_64/multiarch/memcpy-ssse3.S



More information about the dev mailing list