4
$ cat /proc/meminfo | grep Dirty
Dirty:              2396 kB

How do I view in which files (at least as a mountid:inode pairs) are those 599 dirty pages located?

$ cat /proc/meminfo | grep Cached
Cached:          6171156 kB

How do I view which files are in cache without vmtouching the entire filesystem?

Maybe there is some netlink or debugfs or /dev/kmem-reading or whatever trick to do this?

  • 1
    I doubt they can be monitored as there is absolutely no good reason to do so. Dirty pages simply mean that they're pending a disk write. This is done to optimize overall system operations and would be quite unsuccessful if it was monitorable. It's fairly easy to assume that most dirty pages represent latest writes from your applications. – Julie Pelletier Feb 26 '17 at 0:26
  • "latest writes from your applications" -> that's why I may want to inspect it. Non-intrusive system-wide "what's happening on my system". I expect kernel to already know it, so the problem is only to persuade it to tell. – Vi. Feb 26 '17 at 0:33
  • 1
    @Vi. I expect the kernel readily knows which blocks are cached or dirty, but mapping that to files may be quite a bit tougher. – Celada Feb 26 '17 at 2:43
  • 1
    @Celada, As a minimum there should be information which device has dirty pages pending. – Vi. Feb 26 '17 at 3:36
  • 2
    Would flushing the caches and check what is being flushed (like with blktrace or stap) be an option for you? – Stéphane Chazelas Feb 26 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.