[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1637075294-30747-1-git-send-email-guanghuifeng@linux.alibaba.com>
Date: Tue, 16 Nov 2021 23:08:14 +0800
From: Guanghui Feng <guanghuifeng@...ux.alibaba.com>
To: catalin.marinas@....com, will@...nel.org, maz@...nel.org,
qperret@...gle.com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: baolin.wang@...ux.alibaba.com, zhuo.song@...ux.alibaba.com,
zhangliguang@...ux.alibaba.com
Subject: [PATCH] arm64: clear_page: use stnp non-temporal instruction for performance optimizing
When clear page mem, there is no need to alloc cache for storing these
mem value. And the copy_page.S have used stnp instruction for optimizing.
So I rewrite the clear_page.S with stnp. At the same time, I have tested it
with stnp instruction which will get about twice the performance improvement.
Signed-off-by: Guanghui Feng <guanghuifeng@...ux.alibaba.com>
---
arch/arm64/lib/clear_page.S | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/lib/clear_page.S b/arch/arm64/lib/clear_page.S
index b84b179..e9dc2d6 100644
--- a/arch/arm64/lib/clear_page.S
+++ b/arch/arm64/lib/clear_page.S
@@ -15,13 +15,18 @@
* x0 - dest
*/
SYM_FUNC_START_PI(clear_page)
- mrs x1, dczid_el0
- and w1, w1, #0xf
- mov x2, #4
- lsl x1, x2, x1
-
-1: dc zva, x0
- add x0, x0, x1
+ mov x1, #0
+ mov x2, #0
+1:
+ stnp x1, x2, [x0]
+ stnp x1, x2, [x0, #16]
+ stnp x1, x2, [x0, #32]
+ stnp x1, x2, [x0, #48]
+ stnp x1, x2, [x0, #64]
+ stnp x1, x2, [x0, #80]
+ stnp x1, x2, [x0, #96]
+ stnp x1, x2, [x0, #112]
+ add x0, x0, #128
tst x0, #(PAGE_SIZE - 1)
b.ne 1b
ret
--
1.8.3.1
Powered by blists - more mailing lists