I've been meaning to ask this for a long time. When I added inode stats to collectl one of the driving reasons was because sar did it. I had never paid that much attention to the output other than to confirm it matched, which it did.
But some time later, and this was still awhile ago, I did some experiments to make sure the numbers were being reported correctly and I believe they are not! The one problem I see is the number of unused dentry cache entries. It's described in the /proc man page as:
Code:
/proc/sys/fs/dentry-state (since Linux 2.2)
This file contains information about the status of the directory
cache (dcache). The file contains six numbers, nr_dentry,
nr_unused, age_limit (age in seconds), want_pages (pages
requested by system) and two dummy values.
* nr_dentry is the number of allocated dentries (dcache
entries). This field is unused in Linux 2.2.
* nr_unused is the number of unused dentries.
To my way of thinking, if something is 'unused' and you start using if by creating a bunch of directories, I'd expect that number to go down since now more are being used. However that number goes up instead! When I create 1K files it goes up by 1K rather than down.
On the one hand it's hard to believe this has been around since almost the dawn of linux and it's documented as 'unused'. So either I'm misinterpretting it or nobody noticed/cared. Thoughts?
-mark