Reworking the ppc32 mm helps me find interesting bugs in the existing bug,
well, brown paper bag for me, I made this one a while ago.
The routine flush_hash_one_pte() used by ptep_test_and_clear_young()
wasn't properly recaclulating the vaddr from the pte pointer &
page->index. The result is that we probably never flushed things from
the hash, so that's at least the _second_ bug affecting
ptep_test_and_clear_young(), swap on ppc32 must have been really broken
:(
This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ptepage = virt_to_page(ptep);
mm = (struct mm_struct *) ptepage->mapping;
ptephys = __pa(ptep) & PAGE_MASK;
- addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 9);
+ addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 10);
flush_hash_pages(mm->context, addr, ptephys, 1);
}