From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dsl027-180-168.sfo1.dsl.speakeasy.net ([216.27.180.168]:42664 "EHLO sunset.davemloft.net") by vger.kernel.org with ESMTP id S2992738AbWJTWWq (ORCPT ); Fri, 20 Oct 2006 18:22:46 -0400 Date: Fri, 20 Oct 2006 15:22:47 -0700 (PDT) Message-Id: <20061020.152247.111203913.davem@davemloft.net> Subject: Re: [PATCH 1/3] Fix COW D-cache aliasing on fork From: David Miller In-Reply-To: References: <20061020214916.GA27810@linux-mips.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org To: torvalds@osdl.org Cc: ralf@linux-mips.org, nickpiggin@yahoo.com.au, akpm@osdl.org, linux-kernel@vger.kernel.org, anemo@mba.ocn.ne.jp, linux-arch@vger.kernel.org, schwidefsky@de.ibm.com, James.Bottomley@steeleye.com List-ID: From: Linus Torvalds Date: Fri, 20 Oct 2006 15:02:39 -0700 (PDT) > On Fri, 20 Oct 2006, Ralf Baechle wrote: > > When I delete the call (not part of my patchset) it means 12% faster > > fork. But I'm not proposing this for 2.6.19. > > I just suspect it means a _buggy_ fork. > > It so happens (I think), that fork is big enough that it probably flushes > the L1 cache _anyway_. My understanding is that this works because in Ralf's original patch (which is the context in which he is removing the flush_cache_mm() call), he uses kmap()/kunmap() to map the page(s) being accessed at a kernel virtual address which will fall into the same cache color as the user virtual address --> no alias problems. Since he does this for every page touched on the kernel side during dup_mmap(), the existing flush_cache_mm() call in dup_mmap() does in fact become redundant.