From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Feng Xue OS <fxue@os.amperecomputing.com>,
Siddhesh Poyarekar <siddhesh@gotplt.org>,
'GNU C Library' <libc-alpha@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH] aarch64: Add tunable glibc.memset.dc_zva_threshold
Date: Tue, 13 Aug 2019 13:11:00 -0000 [thread overview]
Message-ID: <VI1PR0801MB21278074A691DC6E82F1BD8483D20@VI1PR0801MB2127.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <BYAPR01MB4869818C970E0A2F6FBAD4E9F7D70@BYAPR01MB4869.prod.exchangelabs.com>
Hi Feng,
> This version disable DC ZVA in emag.
That looks good to me.
diff --git a/sysdeps/aarch64/multiarch/memset_base64.S b/sysdeps/aarch64/multiarch/memset_base64.S
index 9a62325..c0cccba 100644
--- a/sysdeps/aarch64/multiarch/memset_base64.S
+++ b/sysdeps/aarch64/multiarch/memset_base64.S
@@ -23,6 +23,7 @@
# define MEMSET __memset_base64
#endif
+/* To disable DC ZVA, set this threshold to 0. */
#ifndef DC_ZVA_THRESHOLD
# define DC_ZVA_THRESHOLD 512
#endif
@@ -91,11 +92,12 @@ L(set96):
.p2align 4
L(set_long):
stp val, val, [dstin]
+ bic dst, dstin, 15
+#if DC_ZVA_THRESHOLD
cmp count, DC_ZVA_THRESHOLD
ccmp val, 0, 0, cs
- bic dst, dstin, 15
b.eq L(zva_64)
-
+#endif
/* Small-size or non-zero memset does not use DC ZVA. */
sub count, dstend, dst
@@ -105,7 +107,11 @@ L(set_long):
* count is less than 33 bytes, so as to bypass 2 unneccesary stps.
*/
sub count, count, 64+16+1
+
+#if DC_ZVA_THRESHOLD
+ /* Align loop on 16-byte boundary, this might be friendly to i-cache. */
nop
+#endif
1: stp val, val, [dst, 16]
stp val, val, [dst, 32]
@@ -121,6 +127,7 @@ L(set_long):
stp val, val, [dstend, -16]
ret
+#if DC_ZVA_THRESHOLD
.p2align 3
L(zva_64):
stp val, val, [dst, 16]
@@ -173,6 +180,7 @@ L(zva_64):
1: stp val, val, [dstend, -32]
stp val, val, [dstend, -16]
ret
+#endif
END (MEMSET)
libc_hidden_builtin_def (MEMSET)
diff --git a/sysdeps/aarch64/multiarch/memset_emag.S b/sysdeps/aarch64/multiarch/memset_emag.S
index 1c1fabc..c2aed62 100644
--- a/sysdeps/aarch64/multiarch/memset_emag.S
+++ b/sysdeps/aarch64/multiarch/memset_emag.S
@@ -21,12 +21,14 @@
# define MEMSET __memset_emag
/*
- * Using dc zva to zero memory does not produce better performance if
+ * Using DC ZVA to zero memory does not produce better performance if
* memory size is not very large, especially when there are multiple
- * processes/threads contending memory/cache. Here we use a somewhat
- * large threshold to trigger usage of dc zva.
-*/
-# define DC_ZVA_THRESHOLD 1024
+ * processes/threads contending memory/cache. Here we set threshold to
+ * zero to disable using DC ZVA, which is good for multi-process/thread
+ * workloads.
+ */
+
+# define DC_ZVA_THRESHOLD 0
# include "./memset_base64.S"
#endif
OK
Wilco
next prev parent reply other threads:[~2019-08-13 13:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 16:18 Wilco Dijkstra
2019-08-07 14:13 ` Siddhesh Poyarekar
2019-08-08 3:56 ` Feng Xue OS
2019-08-13 13:11 ` Wilco Dijkstra [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-07-26 11:58 Feng Xue OS
2019-07-26 15:17 ` Szabolcs Nagy
2019-07-29 2:25 ` Feng Xue OS
2019-07-29 3:46 ` Siddhesh Poyarekar
2019-07-29 3:49 ` Siddhesh Poyarekar
2019-08-02 1:50 ` Feng Xue OS
2019-08-02 3:07 ` Siddhesh Poyarekar
2019-08-02 3:10 ` Siddhesh Poyarekar
2019-08-02 4:31 ` Feng Xue OS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VI1PR0801MB21278074A691DC6E82F1BD8483D20@VI1PR0801MB2127.eurprd08.prod.outlook.com \
--to=wilco.dijkstra@arm.com \
--cc=fxue@os.amperecomputing.com \
--cc=libc-alpha@sourceware.org \
--cc=nd@arm.com \
--cc=siddhesh@gotplt.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).