linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: lib: Optimize partial checksum ops using prefetching.

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: lib: Optimize partial checksum ops using prefetching.
From: "Steven J. Hill" <Steven.Hill@imgtec.com>
Date: Tue, 21 Jan 2014 14:58:44 -0600
Cc: <linux-mips@linux-mips.org>
In-reply-to: <20140121204938.GW14169@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1390321122-25634-1-git-send-email-Steven.Hill@imgtec.com> <20140121204938.GW14169@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
On 01/21/2014 02:49 PM, Ralf Baechle wrote:
On Tue, Jan 21, 2014 at 10:18:42AM -0600, Steven J. Hill wrote:

From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>

Use the PREF instruction to optimize partial checksum operations.

Prefetch operations may cause obscure bus error exceptions on some systems
such as Malta, for example, when prefetching beyond the end of memory.
It may also mean memory regions that are just undergoing a DMA transfer
are being brought back into cache.

This pretty much means that pref is only safe to use on cache-coherent
systems.

So, could we have:

   #ifdef CONFIG_DMA_NONCOHERENT
   #undef CONFIG_CPU_HAS_PREFETCH
   #endif
   #define PREFSIZE   (1 << MIPS_L1_CACHE_SHIFT)

and then use the PREFSIZE value instead of the hardcoded value of 32?

Steve


<Prev in Thread] Current Thread [Next in Thread>