linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc32: fix ptep_test_and_clear_young
@ 2005-02-21  5:09 Benjamin Herrenschmidt
  0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2005-02-21  5:09 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linuxppc-dev list

Hi !

ppc32's implementation of ptep_test_and_clear_young() has a logic error
which makes it fail to flush the hash table. Thus PAGE_ACCESSED is
almost never set again after beeing cleared (unless something else cause
that hash entry to be flushed).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/include/asm-ppc/pgtable.h
===================================================================
--- linux-work.orig/include/asm-ppc/pgtable.h	2005-01-24 17:09:50.000000000 +1100
+++ linux-work/include/asm-ppc/pgtable.h	2005-02-21 16:00:26.000000000 +1100
@@ -560,12 +560,12 @@
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
 	unsigned long old;
-	old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED);
+	old = pte_update(ptep, _PAGE_ACCESSED, 0);
 #if _PAGE_HASHPTE != 0
 	if (old & _PAGE_HASHPTE)
 		flush_hash_one_pte(ptep);
 #endif
-	return old != 0;
+	return (old & _PAGE_ACCESSED) != 0;
 }
 
 static inline int ptep_test_and_clear_dirty(pte_t *ptep)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-21  5:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21  5:09 [PATCH] ppc32: fix ptep_test_and_clear_young Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).