Skip to content

Commit

Permalink
ARCv2: memset: don't prefetch for len == 0 which happens a alot
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vineet Gupta committed Aug 17, 2023
1 parent c8ee610 commit 1918693
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arc/lib/memset-archs.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1918693

Please sign in to comment.