1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Kernel: Make Region::amount_shared() and amount_resident() lazy-aware

Don't count the lazy-committed page towards shared/resident amounts.
This commit is contained in:
Andreas Kling 2021-01-02 00:47:55 +01:00
parent f5384d7c70
commit 14493645e0

View file

@ -219,7 +219,7 @@ size_t Region::amount_resident() const
size_t bytes = 0;
for (size_t i = 0; i < page_count(); ++i) {
auto* page = physical_page(i);
if (page && !page->is_shared_zero_page())
if (page && !page->is_shared_zero_page() && !page->is_lazy_committed_page())
bytes += PAGE_SIZE;
}
return bytes;
@ -230,7 +230,7 @@ size_t Region::amount_shared() const
size_t bytes = 0;
for (size_t i = 0; i < page_count(); ++i) {
auto* page = physical_page(i);
if (page && page->ref_count() > 1 && !page->is_shared_zero_page())
if (page && page->ref_count() > 1 && !page->is_shared_zero_page() && !page->is_lazy_committed_page())
bytes += PAGE_SIZE;
}
return bytes;