Kernel+SystemMonitor: Expose amount of per-process clean inode memory

This is memory that's loaded from an inode (file) but not modified in
memory, so still identical to what's on disk. This kind of memory can
be freed and reloaded transparently from disk if needed.
This commit is contained in:
Andreas Kling 2019-12-29 12:45:58 +01:00
commit c74cde918a
Notes: sideshowbarker 2024-07-19 10:34:08 +09:00
9 changed files with 42 additions and 0 deletions

View file

@ -36,6 +36,16 @@ InodeVMObject::~InodeVMObject()
ASSERT(inode().vmobject() == this);
}
size_t InodeVMObject::amount_clean() const
{
size_t count = 0;
for (int i = 0; i < m_dirty_pages.size(); ++i) {
if (!m_dirty_pages.get(i) && m_physical_pages[i])
++count;
}
return count * PAGE_SIZE;
}
size_t InodeVMObject::amount_dirty() const
{
size_t count = 0;