1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +00:00

Kernel: Memory purging was incorrectly "purging" the shared zero page

This caused us to report one purged page per occurrence of the shared
zero page in a purgeable memory region, despite it being a no-op.

Thanks to Sergey for spotting the bad assertion removal that led to
this being found!
This commit is contained in:
Andreas Kling 2020-05-07 09:41:50 +02:00
parent 6fe83b0ac4
commit beaec6bd2d
2 changed files with 2 additions and 1 deletions

View file

@ -74,7 +74,7 @@ int PurgeableVMObject::purge_impl()
return 0;
int purged_page_count = 0;
for (size_t i = 0; i < m_physical_pages.size(); ++i) {
if (m_physical_pages[i])
if (m_physical_pages[i] && !m_physical_pages[i]->is_shared_zero_page())
++purged_page_count;
m_physical_pages[i] = MM.shared_zero_page();
}