diff options
author | Vineet Gupta <vgupta@kernel.org> | 2020-02-07 12:27:02 -0800 |
---|---|---|
committer | Vineet Gupta <vgupta@kernel.org> | 2023-08-17 12:40:26 -0700 |
commit | 1918693ff1891ba57af22dbbf511cf300158a975 (patch) | |
tree | c3c498cb41a36f3315da04350fe6a631cc6b666e /arch/arc/lib | |
parent | c8ee610afe654da7276d4aa8ad2bb60ffff6ddfc (diff) | |
download | lwn-1918693ff1891ba57af22dbbf511cf300158a975.tar.gz lwn-1918693ff1891ba57af22dbbf511cf300158a975.zip |
ARCv2: memset: don't prefetch for len == 0 which happens a alot
This avoids potential "bleeding" when size == 0 as cache line would be
dirtied (and possibly fetched from other cores) and due to the same
reaons more optimal too.
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Diffstat (limited to 'arch/arc/lib')
-rw-r--r-- | arch/arc/lib/memset-archs.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arc/lib/memset-archs.S b/arch/arc/lib/memset-archs.S index d2e09fece5bc..d0a5cec4cdca 100644 --- a/arch/arc/lib/memset-archs.S +++ b/arch/arc/lib/memset-archs.S @@ -36,12 +36,13 @@ #endif ENTRY_CFI(memset) - PREFETCHW_INSTR r0, 0 ; Prefetch the first write location mov.f 0, r2 ;;; if size is zero jz.d [blink] mov r3, r0 ; don't clobber ret val + PREFETCHW_INSTR r0, 0 ; Prefetch the first write location + ;;; if length < 8 brls.d.nt r2, 8, .Lsmallchunk mov.f lp_count,r2 |