Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757976AbZAPFd7 (ORCPT ); Fri, 16 Jan 2009 00:33:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751429AbZAPFdo (ORCPT ); Fri, 16 Jan 2009 00:33:44 -0500 Received: from palinux.external.hp.com ([192.25.206.14]:57015 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbZAPFdn (ORCPT ); Fri, 16 Jan 2009 00:33:43 -0500 Date: Thu, 15 Jan 2009 22:33:38 -0700 From: Matthew Wilcox To: MinChan Kim Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, npiggin@suse.de, akpm@linux-foundation.org Subject: Re: [PATCH] Remove needless flush_dcache_page call Message-ID: <20090116053338.GC31013@parisc-linux.org> References: <20090116052804.GA18737@barrios-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090116052804.GA18737@barrios-desktop> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1687 Lines: 37 On Fri, Jan 16, 2009 at 02:28:04PM +0900, MinChan Kim wrote: > Now, Anyone don't maintain cramfs. > I don't know who is maintain romfs. so I send this patch to linux-mm, > lkml, linux-dev. > > I am not sure my thought is right. > > When readpage is called, page with argument in readpage is just new > allocated because kernel can't find that page in page cache. > > At this time, any user process can't map the page to their address space. > so, I think D-cache aliasing probelm never occur. > > It make sense ? Sorry, no. You have to call fluch_dcache_page() in two situations -- when the kernel is going to read some data that userspace wrote, *and* when userspace is going to read some data that the kernel wrote. From a quick look at the patch, this seems to be the second case. The kernel wrote data to a pagecache page, and userspace should be able to read it. To understand why this is necessary, consider a processor which is virtually indexed and has a writeback cache. The kernel writes to a page, then a user process reads from the same page through a different address. The cache doesn't find the data the kernel wrote because it has a different virtual index, so userspace reads stale data. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- 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/