From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org,
Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH v2 5/6] i.MX: system.c: Tweak prefetch settings for performance
Date: Tue, 14 Jun 2016 18:29:52 -0700 [thread overview]
Message-ID: <1465954193-5894-6-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1465954193-5894-1-git-send-email-andrew.smirnov@gmail.com>
Update Prefetch Control Register settings to match that of Freescale's
Linux tree. As the commit e3addf1b773964eac7f797e8538c69481be4279c
states (author Nitin Garg):
"... set Prefetch offset to 15, since it improves memcpy performance by
35%. Don't enable Incr double Linefill enable since it adversely affects
memcpy performance by about 32MB/s and reads by 90MB/s. Tested with 4K
to 16MB sized src and dst aligned buffer..."
Those results are also corroborated by our own testing.
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/mach-imx/system.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index f0a9787..9ea01e3 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -111,8 +111,12 @@ void __init imx_init_l2cache(void)
val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL);
val |= L310_PREFETCH_CTRL_DBL_LINEFILL |
L310_PREFETCH_CTRL_INSTR_PREFETCH |
- L310_PREFETCH_CTRL_DATA_PREFETCH |
- L310_PREFETCH_CTRL_DBL_LINEFILL_INCR;
+ L310_PREFETCH_CTRL_DATA_PREFETCH;
+
+ /* Set perfetch offset to improve performance */
+ val &= ~L310_PREFETCH_CTRL_OFFSET_MASK;
+ val |= 15;
+
writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL);
}
--
2.5.5
next prev parent reply other threads:[~2016-06-15 1:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 1:29 [PATCH v2 0/6] i.MX L2-cache code cleanups and performance tweaks Andrey Smirnov
2016-06-15 1:29 ` [PATCH v2 1/6] i.MX: system.c: Convert goto to if statement Andrey Smirnov
2016-06-15 1:29 ` [PATCH v2 2/6] i.MX: system.c: Remove redundant errata 752271 code Andrey Smirnov
2016-06-15 1:29 ` [PATCH v2 3/6] i.MX: system.c: Replace magic numbers Andrey Smirnov
2016-06-15 6:18 ` Uwe Kleine-König
2016-06-16 2:00 ` Shawn Guo
2016-06-15 1:29 ` [PATCH v2 4/6] ARM: cache-l2x0: Do not clear bit 23 in prefetch control register Andrey Smirnov
2016-06-15 1:29 ` Andrey Smirnov [this message]
2016-06-15 1:29 ` [PATCH v2 6/6] i.MX: Do not explicitly call l2x0_of_init() Andrey Smirnov
2016-06-15 10:41 ` Arnd Bergmann
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=1465954193-5894-6-git-send-email-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=arnd@arndb.de \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=shawnguo@kernel.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 NNTP newsgroup(s).