]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] ppc64: Fix pages marked dirty abusively
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 21 Oct 2005 04:12:51 +0000 (14:12 +1000)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 21 Oct 2005 19:17:43 +0000 (12:17 -0700)
commitc286041fa0ed7f4c8bc38323041d34b25304694e
tree6aad2e082c3e57f00024f86287444a8ded086933
parentbf732631e702de5ce115a5cc9f74c2eec67831fb
[PATCH] ppc64: Fix pages marked dirty abusively

While working on 64K pages, I found this little buglet in our
update_mmu_cache() implementation.

The code calls __hash_page() passing it an "access" parameter (the type
of access that triggers the hash) containing the bits _PAGE_RW and
_PAGE_USER of the linux PTE.  The latter is useless in this case and the
former is wrong.  In fact, if we have a writeable PTE and we pass
_PAGE_RW to hash_page(), it will set _PAGE_DIRTY (since we track dirty
that way, by hash faulting !dirty) which is not what we want.

In fact, the correct fix is to always pass 0. That means that only
read-only or already dirty read write PTEs will be preloaded. The
(hopefully rare) case of a non dirty read write PTE can't be preloaded
this way, it will have to fault in hash_page on the actual access.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/mm/init.c