Hello Dave,
These two patches are used to improve the performance of "kmem -s
[address]".
Current code need to search all kmem_caches twice. It is a waste of
time. With my patch, the address is sent to "dump_kmem_cache" function
to make the second search be restricted to the kmem_cache found in the
first search. It means the second search is neglected.
I have implemented the improvement for three types of kmem_cache. The
search for "slub" does not waste that much time as its peers, so I did
not modify the code related to "slub". Additionally, I only get the
environment to test my first patch, so the second patch has not been tested.
Here is the statistic of my test on RHEL6.2 x86_64, the vmcore used for
testing has about 150000 kmem_caches
commands in file:
1. only 'quit'
origin code : about 36s
with patch : about 36s
2. 1 time of searching the 100000th kmem_cache
origin code : about 59s
with patch : about 39s
3. 100 times of searching the 100000th kmem_cache
origin code : about 38min30s
with patch : about 5min
p.s.
If I create a kmem_cache called "list", a little confusion may happen
when using "kmem -s list". I am wondering is it necessary to introduce
an another option replacing list to avoid such collision.
--
--
Regards
Qiao Nuohan