Page aging broken in 2.6

From: Benjamin Herrenschmidt
Date: Fri Dec 26 2003 - 02:32:27 EST


HI !

I don't know if x86 is affected (I suspect not) but ppc and ppc64
definitely are.

in mm/rmap.c, in page_referenced(), we do that twice:

if (ptep_test_and_clear_young(pte))
referenced++;

And we never flush the TLB entry.

I don't know if x86 (or other archs really using page tables) will
actually set the referenced bit again in the PTE if it's already set
in the TLB, if not, then x86 needs a flush too.

ppc and ppc64 need a flush to evict the entry from the hash table or
we'll never set the _PAGE_ACCESSED bit anymore.

On the other hand, I'd like to propose a semantic change here, by
changing ptep_test_and_clear_dirty() as well so that the flush is done
by the arch function and not explicitely by the generic code in both
cases. (I'm not sure if it's worth adding an mm parameter to the call
or if the arch will figure it out, we don't have it at hand in
page_referenced()).

That way, arch that don't need the flush (if any) can avoid it, and
in the case of ptep_test_and_clear_dirty, I may have a better way of
implementing it without a flush in mind.

Comments ?

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/