Reputation: 28272
I want to see how many blocks of a file are being stored in the kernel's disk page cache. Is there any interface I can look into to check this out? Perhaps something in /proc
?
Upvotes: 3
Views: 104
Reputation: 2730
As far as I know there is nothing like that in /proc
. The overhead of tracking that information and exposing it via /proc
would likely be prohibitive.
As Damon suggested your best bet is mmap()
'ing the file and using mincore()
.
Update: I coded up the mincore()
idea and it seems to work as expected.
Upvotes: 2