mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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:
parent
6fe83b0ac4
commit
beaec6bd2d
Notes:
sideshowbarker
2024-07-19 06:55:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/beaec6bd2dc
2 changed files with 2 additions and 1 deletions
|
@ -448,6 +448,7 @@ RefPtr<PhysicalPage> MemoryManager::allocate_user_physical_page(ShouldZeroFill s
|
|||
if (purged_page_count) {
|
||||
klog() << "MM: Purge saved the day! Purged " << purged_page_count << " pages from PurgeableVMObject{" << &purgeable_vmobject << "}";
|
||||
page = find_free_user_physical_page();
|
||||
ASSERT(page);
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue