From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265289AbUEZC0e (ORCPT ); Tue, 25 May 2004 22:26:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265288AbUEZC0e (ORCPT ); Tue, 25 May 2004 22:26:34 -0400 Received: from fw.osdl.org ([65.172.181.6]:41419 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S265287AbUEZC0c (ORCPT ); Tue, 25 May 2004 22:26:32 -0400 Date: Tue, 25 May 2004 19:26:21 -0700 (PDT) From: Linus Torvalds To: Andrea Arcangeli cc: Ivan Kokshaysky , Matthew Wilcox , Benjamin Herrenschmidt , Andrew Morton , Linux Kernel list , Ingo Molnar , Ben LaHaise , linux-mm@kvack.org, Architectures Group Subject: Re: [PATCH] ppc64: Fix possible race with set_pte on a present PTE In-Reply-To: <20040525224258.GK29378@dualathlon.random> Message-ID: References: <20040525034326.GT29378@dualathlon.random> <20040525114437.GC29154@parcelfarce.linux.theplanet.co.uk> <20040525212720.GG29378@dualathlon.random> <20040525215500.GI29378@dualathlon.random> <20040526021845.A1302@den.park.msu.ru> <20040525224258.GK29378@dualathlon.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 May 2004, Andrea Arcangeli wrote: > > after various searching on the x86 docs I found: > > Whenever a page-directory or page-table entry is changed (including when > the present flag is set to zero), the operating-system must immediately > invalidate the corresponding entry in the TLB so that it can be updated > the next time the entry is referenced. > > according to the above we'd need to flush the tlb even in > do_anonymous_page on x86, or am I reading it wrong? You're reading it wrong. The "including when the present flag is set to zero" part does not mean that the present flag was zero _before_, it means "is being set to zero" as in "having been non-zero before that". Anytime the P flag was clear _before_, we don't need to invalidate, because non-present entries are not cached in the TLB. Linus