Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966330Ab0BZVx6 (ORCPT ); Fri, 26 Feb 2010 16:53:58 -0500 Received: from gate.crashing.org ([63.228.1.57]:58371 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966217Ab0BZVx5 (ORCPT ); Fri, 26 Feb 2010 16:53:57 -0500 Subject: Re: USB mass storage and ARM cache coherency From: Benjamin Herrenschmidt To: Alan Stern Cc: Catalin Marinas , Matthew Dharm , Oliver Neukum , Russell King - ARM Linux , Greg KH , "Mankad, Maulik Ojas" , Sergei Shtylyov , Sebastian Siewior , linux-usb@vger.kernel.org, linux-kernel , James Bottomley , "Shilimkar, Santosh" , Pavel Machek , Ming Lei , linux-arm-kernel In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Sat, 27 Feb 2010 08:51:22 +1100 Message-ID: <1267221082.23523.1822.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 29 On Fri, 2010-02-26 at 11:52 -0500, Alan Stern wrote: > > For mmap'ed pages (and present in the page cache), is it guaranteed that > > the HCD driver won't write to it once it has been mapped into user > > space? If that's the case, it may solve the problem by just reversing > > the meaning of PG_arch_1 on ARM and assume that a newly allocated page > > has dirty D-cache by default. > > Nothing is guaranteed. The HCD will write to wherever it is asked. If > a driver does input to an mmap'ed page, the HCD won't even know that > the page is mmap'ed. Right but that won't happen unless somebody explicitely caused that input to happen, typically, a userspace read(). I$/D$ coherency isn't implicit in that case. The question is more when the kernel itself moves a page in/out from underneath the application (mmap'ed executable pages). One it's mapped in, it won't be written to by the HCD unless something explicitely does something to cause that write. If it's swapped out and back in, it will have been unmapped. Cheers, Ben. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/