]> git.hungrycats.org Git - linux/commit
[PATCH] s390: rmap optimization.
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:43:19 +0000 (18:43 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:43:19 +0000 (18:43 -0800)
commit83b416461047903ada908a9bdfa41c958ad78dde
tree57fae63ea620be80c63fce0ca6a8b636ea87ffaa
parentf8e8784a619a95a2a795971550345822e2d1bdc4
[PATCH] s390: rmap optimization.

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

while working on my mm patch for s390 I played with rmap a bit, adding
BUG statements and the like. While doing so I noticed some room for
improvement in rmap. Its minor stuff but anyway...

The first observation is that the pte chain array doesn't have holes,
meaning that from the pte_chain_idx() of the first array every slot of
all following pte chain arrays are full. That is there can't be NULL
pointers. The "if (!pte_paddr)" check in try_to_unmap() can be removed
and if the loop in page_referenced() is started from pte_chain_idx(pc)
then the "if (!pte_paddr)" in page_referenced() can be removed as well.

The second observation is that the first pte array of a pte chain has
at least one entry. Empty pte chain arrays are always freed immediatly
after the last entry was removed. Because of that victim_i can be
calculated in a simpler way. Instead of setting victim_i to -1 and then
check in each loop iteration against -1 victim_i can just be set to
the pte_chain_idx of the first pte chain array.
mm/rmap.c