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: References: <1085369393.15315.28.camel@gaston> <1085371988.15281.38.camel@gaston> <1085373839.14969.42.camel@gaston> <20040525034326.GT29378@dualathlon.random> <20040525114437.GC29154@parcelfarce.linux.theplanet.co.uk> <20040525153501.GA19465@foobazco.org> <20040525102547.35207879.davem@redhat.com> <20040525105442.2ebdc355.davem@redhat.com> <1085521251.24948.127.camel@gaston> Content-Type: text/plain Message-Id: <1085522860.15315.133.camel@gaston> Mime-Version: 1.0 Date: Wed, 26 May 2004 08:07:41 +1000 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Linus Torvalds Cc: "David S. Miller" , wesolows@foobazco.org, willy@debian.org, Andrea Arcangeli , Andrew Morton , Linux Kernel list , mingo@elte.hu, bcrl@kvack.org, linux-mm@kvack.org, Linux Arch list List-ID: > static inline void ptep_update_dirty_accessed(pte_t *ptep, pte_t entry, int dirty) > { > unsigned long bits = pte_value(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED); > unsigned long tmp; > > __asm__ __volatile__( > "1: lwarx %0,0,%3\n\ > or %0,%2,%0\n\ > stwcx. %0,0,%3\n\ > bne- 1b" > :"=&r" (tmp), "=m" (*ptep) > :"r" (bits), "r" (ptep) > :"cc"); > } > > /* Make asm-generic/pgtable.h know about it.. */ > #define ptep_update_dirty_accessed ptep_update_dirty_accessed That looks good on a first look, I need to re-read the whole discussion since yesterday through to make sure I didn't miss anything. Note that I'd rather call the function ptep_set_* than ptep_update_* to make clear that it can only ever be used to _set_ those bits. 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