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>