]> git.itanic.dy.fi Git - scan-pagemap/commit
print_pid_stats: Revert order of pageframe tree and process list are traversed
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 16 Oct 2011 18:20:20 +0000 (21:20 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 16 Oct 2011 18:20:20 +0000 (21:20 +0300)
commit345ef6a3f9fa03089c4d18ff02162a2a7299c80c
treeaa9aaeb776d984a5c6b1fc13ad8d5d0fc9bd52ca
parent7638cbfb6bfe1662173441b1b2f9b13995a96c87
print_pid_stats: Revert order of pageframe tree and process list are traversed

The pageframe tree is usually quite big, in order of dozens of
megabytes. The process list on the other hand is usually quite small,
usually in the order of tens of kilobytes. The process list thus can
fit entirely in L2 (or even in L1) cache whereas the pageframe tree
most likely does not fit in any cache at all.

Therefore, when calculating the pid statistics, walking through the
page frame tree as many times as there are processes in the process
list will likely cause very big traffic to the memory bus. Changing
the ordering of the loops will significantly increase cache locality
and reduce the memory bus traffic, decreasing the execution times a
lot.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
analyze.c