From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbdARW5u (ORCPT ); Wed, 18 Jan 2017 17:57:50 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:49842 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbdARW5q (ORCPT ); Wed, 18 Jan 2017 17:57:46 -0500 Date: Wed, 18 Jan 2017 22:56:30 +0000 From: Russell King - ARM Linux To: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org, Alamy Liu , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Jonathan Austin , Vladimir Murzin , Thomas Gleixner , Zhaoxiu Zeng , Mark Rutland , Nicolas Pitre , Sebastian Andrzej Siewior , Anna-Maria Gleixner , open list , will.deacon@arm.com Subject: Re: [PATCH 2/7] ARM: Add Broadcom Brahma-B15 readahead cache support Message-ID: <20170118225630.GS27312@n2100.armlinux.org.uk> References: <20170118202927.28740-1-f.fainelli@gmail.com> <20170118202927.28740-3-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170118202927.28740-3-f.fainelli@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2017 at 12:29:21PM -0800, Florian Fainelli wrote: > The readahead cache only intercepts reads, not writes, as such, some > data can remain stale in any of its buffers, such that we need to flush > it, which is an operation that needs to happen in a particular order: > > - disable the readahead cache > - flush it > - call the appropriate cache-v7.S function > - re-enable I really do hope that the above explanation is wrong, because if that's really how it's implemented, it's going to cause coherency problems. It's got to at least monitor writes, otherwise how do you guarantee that the CPU doesn't see stale data? IOW: Consider this at the L2 memory-side interface (iow, downstream of the point-of-coherency): CPU1 CPU2 Read-ahead buffer read cache line C reads cache line C and C+1 writes cache line C+1 read cache line C+1 What ensures that CPU2 sees the written out cache line from CPU1? -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.