From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH] ppc64: Fix possible race with set_pte on a present PTE From: Benjamin Herrenschmidt In-Reply-To: <16566.25617.363386.115466@napali.hpl.hp.com> References: <1085369393.15315.28.camel@gaston> <1085371988.15281.38.camel@gaston> <1085373839.14969.42.camel@gaston> <20040525034326.GT29378@dualathlon.random> <20040525042054.GU29378@dualathlon.random> <16562.52948.981913.814783@napali.hpl.hp.com> <20040525045322.GX29378@dualathlon.random> <16566.25617.363386.115466@napali.hpl.hp.com> Content-Type: text/plain Message-Id: <1085695254.7835.126.camel@gaston> Mime-Version: 1.0 Date: Fri, 28 May 2004 08:00:54 +1000 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: davidm@hpl.hp.com Cc: Andrea Arcangeli , Linus Torvalds , Andrew Morton , Linux Kernel list , Ingo Molnar , Ben LaHaise , linux-mm@kvack.org, Architectures Group List-ID: On Fri, 2004-05-28 at 07:56, David Mosberger wrote: > >>>>> On Tue, 25 May 2004 06:53:22 +0200, Andrea Arcangeli said: > > >> If the "accessed" or "dirty" bits are zero, accessing/writing the > >> page will cause a fault which will be handled in a low-level > >> fault handler. The Linux version of these handlers simply turn > >> on the respective bit. See daccess_bit(), iaccess_bit(), and dirty_bit() > >> in arch/ia64/kernel/ivt.S. > > Andrea> so you mean, this is being set in the arch section before > Andrea> ever reaching handle_mm_fault? > > Correct. The low-level fault handlers set the ACCESSED/DIRTY bits > with an atomic compare-and-exchange (on SMP). They don't (normally) > bubble up all the way to the Linux page-fault handler. Same for PPC, but we still have a race where we can reach that code, see my initial mail (typically, because your low level code, for obvious reasons, doesn't take the mm semaphore, thus the page may have been mapped right after you decide to go to do_page_fault and before it takes the mm sem). Ben. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: aart@kvack.org