Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5CC1C43219 for ; Tue, 16 Nov 2021 15:10:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7A9F61BFE for ; Tue, 16 Nov 2021 15:10:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B7A9F61BFE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zrQjLTK8oVGxgaViPWfgAZ/oka8cItbijA0ivKdVfsM=; b=HWJe45uta3zOrN Gf3dBVVk7Ef/YgzU8w49g8bKijU2Gs+w+Aw2naokyqXcOLcCy7CpaC2WLmUaM0a0c+hUoIUlbHfJ1 v/+1M3QYKzfcdNlqUyFX90B/gBVKqYzBy7MpKiUOlMumP4EQX8lmhortZ3BRDIXGpevUHjr3acqiD qPSW8cqkdqlOIjLuxyoZgXw0hma1wmObRTCXEOJvqbeS9EjffzcQLZ9G7ZBombnyGfO6Ec5oXxrUP Cg/3lfbz8Z4eaB01XdE3wwNzqnNQ3wwfb4StGRj8GlgHj5P0CViXxhTJ5jhKypRpiXV2eUcCz8H8J fU40igRPCHZYdt+CuhHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn04x-0026Lg-CX; Tue, 16 Nov 2021 15:08:59 +0000 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn04s-0026Kb-KG for linux-arm-kernel@lists.infradead.org; Tue, 16 Nov 2021 15:08:56 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R101e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04407; MF=guanghuifeng@linux.alibaba.com; NM=1; PH=DS; RN=9; SR=0; TI=SMTPD_---0UwuFdX6_1637075295; Received: from VM20190228-102.tbsite.net(mailfrom:guanghuifeng@linux.alibaba.com fp:SMTPD_---0UwuFdX6_1637075295) by smtp.aliyun-inc.com(127.0.0.1); Tue, 16 Nov 2021 23:08:48 +0800 From: Guanghui Feng To: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, qperret@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: baolin.wang@linux.alibaba.com, zhuo.song@linux.alibaba.com, zhangliguang@linux.alibaba.com Subject: [PATCH] arm64: clear_page: use stnp non-temporal instruction for performance optimizing Date: Tue, 16 Nov 2021 23:08:14 +0800 Message-Id: <1637075294-30747-1-git-send-email-guanghuifeng@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211116_070854_905846_C0925DA9 X-CRM114-Status: UNSURE ( 7.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel