[PATCH] arm64: optimize memcpy_{from,to}io() and memset_io()

Catalin Marinas catalin.marinas at arm.com
Mon Oct 20 06:33:04 PDT 2014


On Tue, Oct 14, 2014 at 05:12:41AM +0100, Joonwoo Park wrote:
> From 1cb0bb81e0d399255e679337929a8438946a4b9a Mon Sep 17 00:00:00 2001
> From: Joonwoo Park <joonwoop at codeaurora.org>
> Date: Mon, 28 Jul 2014 17:32:06 -0700
> Subject: [PATCH v2] arm64: optimize memcpy_{from,to}io() and memset_io()
> 
> Optimize memcpy_{from,to}io() and memset_io() by transferring in 64 bit
> as much as possible with minimized barrier usage.  This simplest
> optimization brings faster throughput compare to current byte-by-byte read
> and write with barrier in the loop.  Code's skeleton is taken from the
> powerpc.
> 
> Reviewed-by: Trilok Soni <tsoni at codeaurora.org>
> Signed-off-by: Joonwoo Park <joonwoop at codeaurora.org>

[...]

> @@ -55,10 +83,28 @@ EXPORT_SYMBOL(__memcpy_toio);
>   */
>  void __memset_io(volatile void __iomem *dst, int c, size_t count)
>  {
> -	while (count) {
> +	u64 qc = c;

I think you should use a (u8) cast here (I'm not sure there is a
requirement for memset to only pass u8 values).

	u64 qc = (u8)c;

Otherwise the patch looks fine. Since Will is handling the next merging
window, you can add:

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list