Your patch updates these counters not only when a slabs are created and
destroyed but also when object is allocated/freed from the slab. This
would hurt runtime performance.
> slab lists for gathering slabinfo stats, resulting in a dramaticNice improvement. I can think of an altenative.
> performance improvement. We tested this after growing the dentry cache to
> 70GB, and the performance improved from 2s to 2ms.
I guess that improvement of your change comes from skipping to iterate
n->slabs_full list. We can achieve it just with introducing only num_slabs.
num_slabs can be updated when a slabs are created and destroyed.
We can calculate num_slabs_full by following equation.
num_slabs_full = num_slabs - num_slabs_partial - num_slabs_free
Calculating both num_slabs_partial and num_slabs_free by iterating
n->slabs_XXX list would not take too much time.