Commit 10bb3972 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc32: fix ptep_test_and_clear_young

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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c0d51c67
...@@ -560,12 +560,12 @@ extern void flush_hash_one_pte(pte_t *ptep); ...@@ -560,12 +560,12 @@ extern void flush_hash_one_pte(pte_t *ptep);
static inline int ptep_test_and_clear_young(pte_t *ptep) static inline int ptep_test_and_clear_young(pte_t *ptep)
{ {
unsigned long old; unsigned long old;
old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED); old = pte_update(ptep, _PAGE_ACCESSED, 0);
#if _PAGE_HASHPTE != 0 #if _PAGE_HASHPTE != 0
if (old & _PAGE_HASHPTE) if (old & _PAGE_HASHPTE)
flush_hash_one_pte(ptep); flush_hash_one_pte(ptep);
#endif #endif
return old != 0; return (old & _PAGE_ACCESSED) != 0;
} }
static inline int ptep_test_and_clear_dirty(pte_t *ptep) static inline int ptep_test_and_clear_dirty(pte_t *ptep)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment