Skip to content

Commit 1918693

Browse files
committed
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>
1 parent c8ee610 commit 1918693

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/arc/lib/memset-archs.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
#endif
3737

3838
ENTRY_CFI(memset)
39-
PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
4039
mov.f 0, r2
4140
;;; if size is zero
4241
jz.d [blink]
4342
mov r3, r0 ; don't clobber ret val
4443

44+
PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
45+
4546
;;; if length < 8
4647
brls.d.nt r2, 8, .Lsmallchunk
4748
mov.f lp_count,r2

0 commit comments

Comments
 (0)